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

[Feature Request] Tag docker images with version and latest #1453

Closed
lonix1 opened this issue May 9, 2020 · 9 comments
Closed

[Feature Request] Tag docker images with version and latest #1453

lonix1 opened this issue May 9, 2020 · 9 comments
Assignees
Labels
cleanup code cleanup and refactoring docker containers & cloud documentation project-related server tools developer tools
Milestone

Comments

@lonix1
Copy link

lonix1 commented May 9, 2020

The latest image does not have a version tag. (I'm confused about the difference between the latest, master and stable branches, but in any case, they do not have version tags.)

This is not standard practice, because you will always pull the latest version, and have no control over versioning. In most environments the infrastructure is tested in development, then tested in staging, then deployed to production. So one "pins" the version to be used, because one knows "it works". If we use latest (or master, stable, etc.), then it will pull a new version automatically, and it might break something. Pinning versions allows us to be sure what is deployed is 100% working as tested.

So please consider doing this:

  • Add version tags. For example, if the latest version is 1.2.3 then the image should be tagged as 1.2.3 as well as with the latest tag.
  • The true "latest" docker image by convention must be tagged as latest, because that is what docker will pull (whereas it looks like on docker hub the latest image is actually "master").

Thanks!

@lonix1 lonix1 changed the title [Feature Request] Tag docker images with version numbers [Feature Request] Tag docker images with version and latest May 9, 2020
@nodiscc nodiscc added cleanup code cleanup and refactoring docker containers & cloud documentation project-related server tools developer tools labels May 10, 2020
@nodiscc nodiscc self-assigned this May 10, 2020
@nodiscc
Copy link
Member

nodiscc commented May 10, 2020

I am currently reworking the documentation in #1389 (almost done) which includes a proposed change in branches/release model. In the proposed model

  • each git tag/branch would have a corresponding Shaarli docker image with the same tag (eg shaarli:release, shaarli:0.90, shaarli:0.90.0, shaarli:0.90.1, shaarli:0.91, shaarli:0.91.0, shaarli:0.92, shaarli:0.92.0...)
  • the stable branch/image is removed
  • the release branch/image is the last tagged/released version (currently named latest)
  • the master branch generates a docker image tagged shaarli:latest instead of master, as the convention dictates

Small example history graph:

git

Advantages: simpler to maintain and understand, follows convention (the latest release is considered stable, development docker image is tagged latest. It scraps the "stable" tag wich was really the oldstable release)

Disadvantages: users who previously used the stable branch/tag upgrade path will need to manually migrate to release

I can update the tooling accordingly if @virtualtam and @ArthurHoaro are OK with the proposed changes.

@nodiscc nodiscc added this to the 0.12.0 milestone May 10, 2020
@lonix1
Copy link
Author

lonix1 commented May 10, 2020

Yes that is excellent!

Though I'm not sure how to prevent the breaking change you mentioned. 😞

@lonix1
Copy link
Author

lonix1 commented May 10, 2020

A workaround in the meantime is to use the image digest.

So to get the "latest" image, with version pinning,

instead of: shaarli/shaarli:master

use: shaarli/shaarli@sha256:cbcaf471281f05a7568f522c69d1c1d670336426774b991d67587a75c3b22a5f

@nodiscc
Copy link
Member

nodiscc commented Sep 12, 2020

Following the merge of #1389, to enable what we discussed, we should do the following:

  • Configure the https://hub.docker.com/ Shaarli account to autobuild images on git tags
    • @ArthurHoaro do you have the Dockerhub credentials for the account?
    • We might-have to force-push tags to trigger the builds...
  • Delete the stable branch/tag
    • this should be noted in the next version release notes, people who have been using the stable branch/image will no longer receive updates, and should switch to the release branch/image
  • Configure the dockerhub account to build an image tagged :latest for pushes on the master branch
    • also worth a mention in release notes, people who have been using the :latest release image will now receive images built from master, and should switch to the release image
  • Rename the latest branch to release

-> PR #1453

@nodiscc nodiscc modified the milestones: 0.13.0, 0.12.0 Sep 12, 2020
@ArthurHoaro
Copy link
Member

ArthurHoaro commented Sep 12, 2020

Configure the hub.docker.com Shaarli account to autobuild images on git tags

I don't understand the issue here, tag builds seem to be already available:

@ArthurHoaro do you have the Dockerhub credentials for the account?

Yes, I am in the shaarli team but you don't seem to be. Do you want me to add you?
(also confirm that this is you)

Rename the latest branch to release

Good call. When we chose this terminology for our branches, we weren't aware that latest was kind of a for Docker to be the latest image available.

@nodiscc
Copy link
Member

nodiscc commented Oct 3, 2020

https://hub.docker.com/u/nodiscc
also confirm that this is you

yes this is me

Do you want me to add you

please

I don't understand the issue here, tag builds seem to be already available:

PEBKAC, docker tags based on semantic versioning tags are indeed working fine.

nodiscc added a commit to nodiscc/Shaarli that referenced this issue Oct 3, 2020
 - always set the target branch for update checks to `release`
 - update documentation (docker image tags, versioning, release procedure, README badges, migration)
 - doc: mention that the default-docker compose file uses the `:latest` image, update docker-compose documentation
 - rename the `:master` docker image tag to `:latest`
 - clarify method/variable names
 - fixes shaarli#1453
@ArthurHoaro
Copy link
Member

You should now have full access.

@nodiscc nodiscc modified the milestones: 0.12.0, 0.13.0 Oct 12, 2020
nodiscc added a commit to nodiscc/Shaarli that referenced this issue Nov 20, 2020
 - always set the target branch for update checks to `release`
 - update documentation (docker image tags, versioning, release procedure, README badges, migration)
 - doc: mention that the default-docker compose file uses the `:latest` image, update docker-compose documentation
 - rename the `:master` docker image tag to `:latest`
 - clarify method/variable names
 - fixes shaarli#1453
@nodiscc
Copy link
Member

nodiscc commented Nov 22, 2020

nodiscc added a commit to nodiscc/Shaarli that referenced this issue Jun 15, 2021
- push an image tagged :latest for builds on master
- push an image with the same tag as the git tag for v*.*.* tags, and for the "release" branch
- update documentation (remove references to Travis/Drone CI
- deprecate stable and master Docker tags (ref. shaarli#1453)
- add deprecation notices to CHANGELOG.md
nodiscc added a commit to nodiscc/Shaarli that referenced this issue Jun 15, 2021
- push images to https://hub.docker.com/r/shaarli/shaarli/tags using a personal access token (access tokens are not available for organizations)
- push an image tagged :latest for builds on master
- push an image with the same tag as the git tag for v*.*.* tags, and for the "release" branch
- update documentation (remove references to Travis/Drone CI
- deprecate stable and master Docker tags (ref. shaarli#1453)
- add deprecation notices to CHANGELOG.md
nodiscc added a commit to nodiscc/Shaarli that referenced this issue Jun 15, 2021
- push images to https://hub.docker.com/r/shaarli/shaarli/tags using a personal access token (access tokens are not available for organizations)
- push an image tagged :latest for builds on master
- push an image with the same tag as the git tag for v*.*.* tags, and for the "release" branch
- update documentation (remove references to Travis/Drone CI
- deprecate stable and master Docker tags (ref. shaarli#1453)
- add deprecation notices to CHANGELOG.md
@nodiscc
Copy link
Member

nodiscc commented Mar 24, 2023

Fixed and clarified in current master and since the 0.12.2 release:

  • The latest image built from master is now tagged latest [1]
  • The image tagged master has been deleted
  • Images for each release have the same tag as the git tag (e.g ghcr.io/shaarli/shaarli:v0.12.2 built from git tag v0.12.2)
  • The image tagged release image is built from the release git branch to which the latest git tag (v0.12.2 currently) has been merged (they do not have the exact same digest because they are actually built from different branches)
  • The image tagged v0.12 is built from the v0.12 git branch to which the latest v0.12.x git tag has been merged
  • The image tagged stable has just been removed, please use release instead.

@nodiscc nodiscc closed this as completed Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup code cleanup and refactoring docker containers & cloud documentation project-related server tools developer tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants