Created
February 3, 2023 04:18
-
-
Save sunny-b/7d637f366551b7e64a627b962b9b40fa to your computer and use it in GitHub Desktop.
dockerfile tag test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo 'FROM alpine:3.12\nENTRYPOINT ["echo", "this is version 1"]' > Dockerfile | |
docker build -t $DOCKER_USER/tag_test . | |
docker run $DOCKER_USER/tag_test # 'this is version 1' | |
docker tag $DOCKER_USER/tag_test $DOCKER_USER/tag_test:1 | |
docker push $DOCKER_USER/tag_test | |
echo 'FROM alpine:3.12\nENTRYPOINT ["echo", "this is version 2"]' > Dockerfile | |
docker build -t $DOCKER_USER/tag_test:2 . | |
docker push $DOCKER_USER/tag_test | |
docker pull $DOCKER_USER/tag_test:latest | |
docker run $DOCKER_USER/tag_test:latest # still says 'this is version 1' | |
# if you want "latest" to get updated, you need to run the following | |
docker build -t $DOCKER_USER/tag_test . | |
docker run $DOCKER_USER/tag_test # 'this is version 2' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment