Skip to content

Instantly share code, notes, and snippets.

@oehrlis
Last active May 3, 2021 10:15
Show Gist options
  • Save oehrlis/7642bb177c38145cccce5897209e7f73 to your computer and use it in GitHub Desktop.
Save oehrlis/7642bb177c38145cccce5897209e7f73 to your computer and use it in GitHub Desktop.
Just an other bash for loop....

Build my local docker tools using a loop

docker pull oraclelinux:7-slim
docker pull 06kellyjac/markdownlint-cli
docker pull treeder/bump
docker pull markdownlint/markdownlint
docker pull alpine
docker pull busybox
for i in $HOME/Development/github.com/oehrlis/docker-*/Dockerfile; do 
REPO_NAME=$(dirname $i|cut -d- -f2)
REPO_DIR=$(dirname $i)
echo "Build new image for $REPO_NAME"
cd $REPO_DIR
docker build -t oehrlis/$REPO_NAME .
docker push oehrlis/$REPO_NAME
docker image prune -f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment