Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lawrencegripper
Last active February 24, 2020 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lawrencegripper/5c25d5fdd13a3233144d87e972b52fb2 to your computer and use it in GitHub Desktop.
Save lawrencegripper/5c25d5fdd13a3233144d87e972b52fb2 to your computer and use it in GitHub Desktop.
Generate docker images of specific size
#!/bin/bash
set -e
set -x
# Push 200mb image
dd if=/dev/urandom of=./file.bin bs=1M count=200
docker build -t lawrencegripper/big:200mb .
docker push lawrencegripper/big:200mb
rm ./file.bin
# Push 600mb image
dd if=/dev/urandom of=./file.bin bs=1M count=600
docker build -t lawrencegripper/big:600mb .
docker push lawrencegripper/big:600mb
rm ./file.bin
# Push 1000mb image
dd if=/dev/urandom of=./file.bin bs=1M count=1000
docker build -t lawrencegripper/big:1000mb .
docker push lawrencegripper/big:1000mb
rm ./file.bin
# Push 2000mb image
dd if=/dev/urandom of=./file.bin bs=1M count=2000
docker build -t lawrencegripper/big:2000mb .
docker push lawrencegripper/big:2000mb
rm ./file.bin
FROM alpine
COPY ./file.bin .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment