fixed build.sh image removal

in recent versions of docker the parent image is not saved as a tag when building
to handle both whom has the official golang image saved and whom is using only to build,
now the scripts pulls (and tags) the official image so that the rm command does not fail
This commit is contained in:
Bryan Joshua Pedini 2023-12-06 09:41:44 +01:00
parent 04f6f8372c
commit 025d79f309
1 changed files with 1 additions and 0 deletions

View File

@ -7,6 +7,7 @@ set -e
REGEX="^[ ]*(#.*)?$"
while read -r VERSION; do
if [[ ! "${VERSION}" =~ $REGEX ]]; then
docker pull golang:${VERSION}
docker build --force-rm --build-arg GO_VERSION=${VERSION} -t bryanpedini/gobuilder:${VERSION} .
docker push bryanpedini/gobuilder:${VERSION}
docker image rm bryanpedini/gobuilder:${VERSION} golang:${VERSION}