-
Notifications
You must be signed in to change notification settings - Fork 70
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
Support docker image versions #187
Comments
Hey there, thanks for the suggestion, should not be a problem.. Currently i'm on vacation. I can look into it next week. |
Thanks!!!! |
Hey @ociotec , I'm not the docker expert, so I'm glad for any input. our build script (also run on travis on every push) builds a docker image and pushes it to the docker registry: https://hub.docker.com/r/xeronimus/poinz always tagged with "latest". If I understand correctly, this is done in the script https://github.com/Zuehlke/poinz/blob/master/build/dockerImage.js, line 99 const cmdArgs = `build -t ${userAndProject}:latest -t ${HEROKU_DEPLOYMENT_TAG} .`; so, in order to publish a correctly tagged image, we would need to change that to: if(gitInfo.branch === 'master'){
const cmdArgs = `build -t ${userAndProject}:latest -t ${HEROKU_DEPLOYMENT_TAG} -t ${pkg.version}.`;
} Am I on the right track? |
Hi, almost on track… you need to put the registry +image path before the image version: if(gitInfo.branch === 'master'){
const cmdArgs = `build -t ${userAndProject}:latest -t ${HEROKU_DEPLOYMENT_TAG} -t ${userAndProject}:${pkg.version} .`;
} This should be done only when there is a tag on master I guess… not sure how to do it on your CI setup… |
Then of course you also need to push both images (latest & the tag one), this should be done in two different docker push commands (annoyingly there is no way to combine several pushes into one command as it’s possible with docker build). |
could you propose the change to the travis.yml file? assuming, the build script tags the (same?) image with "xeronimus/poinz:latest" and "xeronimus/poinz:0.11.3" |
I’m not sure about Travis syntax… according to info at https://docs.travis-ci.com/user/deployment#conditional-releases-with-on maybe it’s something like this: after_success:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login --username="$DOCKER_USERNAME" --password="$DOCKER_PASSWORD";
if [ "$TRAVIS_TAG" == "" ]; then
VERSION="latest"
else
VERSION="$TRAVIS_TAG"
fi
docker push xeronimus/poinz:$VERSION;
fi |
…r branch. push "latest" and "[version]" to docker hub...
…ere was a "recent" change regarding the default behavior up until v0.9.1, docker pushed all tags by default. after that, the option "--all-tags" was introduced. default is now pushing only the "latest" image. docker/cli#2220
Hey there, also thank you for this great project. I just opened a PR with a basic implementation of using git tags as image reference. Feedback is always welcome ;) |
thanks @stawik-mesa for the contribution. you now fetch the version from git tags, no longer from package.json. |
@xeronimus |
But GitHub tags are unique, while a change of the code without a change on the version in the package.json will overwrite the existing tagged image. |
makes total sense. thanks for clarification. |
works as expected. image was tagged (0.11.4) and pushed automatically, see https://hub.docker.com/r/xeronimus/poinz/tags?page=1&ordering=last_updated |
Hi, first of all thanks for your work! we do really enjoy using your tool for planning poker sessions :)
Is there any plan to create docker image versions as it's done in other images? I mean, typically each time a project makes a new release with docker image support a new image version is also released...
This is very useful to point to an specific version of the docker image, instead of pointing to "latest".
Thanks in advance.
The text was updated successfully, but these errors were encountered: