-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Docker images do not push SHA and travis build number tags #376
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
Docker images do not push SHA and travis build number tags #376
Conversation
The title is unclear - do you mean to turn off pushing commit & travis build tags? The reason we tag with the commit sha is because sometimes in-progress changes in one project depend on in-progress changes in another one, so integration tests can run by pulling images via SHA rather than |
See your last comment in the linked issue. If you now think something different I can bring back commit SHA tags. |
Right, so as you notice it explicitly mentioned "remove other tags like travis build number and commit hash -- we might still want those for crossdock images" |
I have added back sha images for xdock |
@yurishkuro is it good now? summary:
|
@@ -48,6 +48,7 @@ services: | |||
|
|||
test_driver: | |||
build: . | |||
image: jaegertracing/test_driver:latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this directive do? We want to make sure we still build from local source
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It uses this name when it builds the image. If you do docker-compose pull
it will pull that image, not build
@@ -29,7 +29,7 @@ PASS=$(shell printf "\033[32mPASS\033[0m") | |||
FAIL=$(shell printf "\033[31mFAIL\033[0m") | |||
COLORIZE=sed ''/PASS/s//$(PASS)/'' | sed ''/FAIL/s//$(FAIL)/'' | |||
DOCKER_NAMESPACE?=$(USER) | |||
DOCKER_TAG?=local | |||
DOCKER_TAG?=latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems unsafe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather build latest than local, it's more convenient.
Note that if you are building images using this Makefile the docker namespace is $USER
so not really docker hub user. I also assume that anybody who is pushing images is cautious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assumption that "anybody who is pushing images is cautious" doesn't comfort me :-), but since it goes under $USER
namespace it should be fine.
@@ -3,7 +3,7 @@ | |||
set -e | |||
|
|||
BRANCH=${BRANCH:?'missing BRANCH env var'} | |||
IMAGE="${REPO:?'missing REPO env var'}:${COMMIT:?'missing COMMIT env var'}" | |||
IMAGE="${REPO:?'missing REPO env var'}:latest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels unsafe. Using COMMIT pinpoints the image precisely, while latest
is kind of vague. What's the harm in keeping COMMIT? Is it because it clutters dockerhub?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it because it clutters dockerhub?
basically yes, But I don't have anything against it. Although I haven't seen other projects doing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would somebody depend on the SHA
tag? latest features will be present in the latest
tag and now we have proper release tags.
# Do not enable echo before the `docker login` command to avoid revealing the password. | ||
set -x | ||
docker login -u $DOCKER_USER -p $DOCKER_PASS | ||
# push all tags, therefore push to repo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we start the whole thing by running some sort of purge on the local repo, to avoid the possibility of some other versions handing around? Especially if this runs in development.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can clear docker registry when starting the CI, but it seems that travis clears registry anyway.
Or we can explicitly push everything:
docker push $REPO:latest
docker push $REPO:sha
, patch, minor, major would be in the if statements.
391f9c9
to
394d07d
Compare
394d07d
to
2adf2c7
Compare
@@ -29,7 +29,7 @@ PASS=$(shell printf "\033[32mPASS\033[0m") | |||
FAIL=$(shell printf "\033[31mFAIL\033[0m") | |||
COLORIZE=sed ''/PASS/s//$(PASS)/'' | sed ''/FAIL/s//$(FAIL)/'' | |||
DOCKER_NAMESPACE?=$(USER) | |||
DOCKER_TAG?=local | |||
DOCKER_TAG?=latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assumption that "anybody who is pushing images is cautious" doesn't comfort me :-), but since it goes under $USER
namespace it should be fine.
…rtracing#376) except for crossdock images
…rtracing#376) except for crossdock images
related to #283
It also fixes all-in-one image, latest is published per commit and added release tags.