Skip to content

Instantly share code, notes, and snippets.

@silverbeak
Created June 19, 2019 17:58
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 silverbeak/06c6d566170dad58fd544ba83663dff4 to your computer and use it in GitHub Desktop.
Save silverbeak/06c6d566170dad58fd544ba83663dff4 to your computer and use it in GitHub Desktop.
I use this script to create a bunch of fake docker images, so I can test my (upcoming) CLI app for removing them
#!/bin/bash
# Usage: ./batchdocker.sh numberOfDockers prefix
# Example: ./batchdocker.sh 10 example.com
# This will create 10 dockers called example.com/fake1, example.com/fake2 ... example.com/fake10
END=$1
PREFIX=$2
for i in $(seq 1 $END); do
docker build --build-arg FAKE_VALUE=FAKE${i} -t ${PREFIX}/fake${i} .;
done
FROM hello-world
ARG FAKE_VALUE=DEFAULT
ENV FAKE_VALUE=$FAKE_VALUE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment