Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to disable latest tag? #59

Open
jmmills opened this issue Jun 28, 2016 · 0 comments
Open

Ability to disable latest tag? #59

jmmills opened this issue Jun 28, 2016 · 0 comments

Comments

@jmmills
Copy link

jmmills commented Jun 28, 2016

If I build push from a develop branch, my latest tag will map to that build, but when I build from my master branch (stable) my latest tag will map to that build.

This could cause confusion when you are working with something like gitflow, where latest would jump between develop and master depending on whichever branch your CI server built and pushed last.

Possible solutions would be a disable latest tag cli argument, which could in turn be set as part of a build running on a CI server, or a YAML element that mapped latest to a specific branch.

Example of problem:

charlie:foo (master)$ cat Dockerfile
FROM alpine:latest
ENTRYPOINT ["/bin/echo"]
CMD ["Hello, World"]
charlie:foo (master)$ captain build
[CAPTAIN] Skipping build of foo:c69a2b5 - image is already built
[CAPTAIN] Tagging image foo:c69a2b5 as foo:latest
[CAPTAIN] Tagging image foo:c69a2b5 as foo:master
charlie:foo (master)$ docker run --rm foo
Hello, World
charlie:foo (master)$ git checkout develop
Switched to branch 'develop'
charlie:foo (develop)$ cat Dockerfile
FROM alpine:latest
ENTRYPOINT ["/bin/echo"]
CMD ["Bye Bye, Cruel World"]
charlie:foo (develop)$ captain build
[CAPTAIN] Building image foo:latest
Step 1 : FROM alpine:latest
 ---> 4e38e38c8ce0
Step 2 : ENTRYPOINT /bin/echo
 ---> Using cache
 ---> c7525f863b54
Step 3 : CMD Bye Bye, Cruel World
 ---> Using cache
 ---> 4f246db51200
Successfully built 4f246db51200
[CAPTAIN] Tagging image foo:latest as foo:79e6028
[CAPTAIN] Tagging image foo:latest as foo:develop
charlie:foo (develop)$ docker run --rm foo
Bye Bye, Cruel World
charlie:foo (develop)$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant