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

Docker tag :latest has older version than :v3.2.2 #662

Closed
BlacCello opened this issue Feb 2, 2021 · 2 comments
Closed

Docker tag :latest has older version than :v3.2.2 #662

BlacCello opened this issue Feb 2, 2021 · 2 comments

Comments

@BlacCello
Copy link

I tried to integrate shfmt into our ci pipeline with the provided docker image on dockerhub.

However, there is a missmatch between the versions and I get different formatting results.

$ docker run --rm -v "$(pwd):/mnt" mvdan/shfmt:latest --version
v3.2.0-29-g31271816

$docker run --rm -v "$(pwd):/mnt" mvdan/shfmt:v3.2.2 --version
v3.2.2

(The formatting differs in my case for a backslash behind && operator, followed by a newline.
The v3.2.2 tag gives the same result as a local install with go (3.2.2))

I'm wondering what the meaning of the "latest" tag for the docker images is and why the version starts with 3.2.0 instead of 3.2.2. If this is intended, it might make sense to introduce a new tag, e.g. latest-stable or latest-release. Otherwise, I would expect that "latest" is the same as "v3.2.2" currently.

@BlacCello BlacCello changed the title Docker tag :latest has older version than :3.2.2 Docker tag :latest has older version than :v3.2.2 Feb 2, 2021
@mvdan
Copy link
Owner

mvdan commented Feb 3, 2021

The latest tag follows the latest development in the default branch, master. And it's technically correct; it currently shows the latest commit, dbbad59, which includes all changes in v3.2.2 as well as newer changes for the upcoming v3.3:

$ docker run --rm mvdan/shfmt:latest --version
Unable to find image 'mvdan/shfmt:latest' locally
latest: Pulling from mvdan/shfmt
3cea36106fa2: Pull complete 
Digest: sha256:bdca5a6640ed432effedc60b6c720cd706f4bd4344a20715e17dc80e69255806
Status: Downloaded newer image for mvdan/shfmt:latest
v3.2.0-32-gdbbad59b

The confusing part here is that, as per semver, master is behind the v3.2.2 tag. This is partly my fault, since I've been tagging bugfix releases off a forked branch, so then Go has to assume that master is older. See golang/go#38985 (comment) for more details. I'll fix that shortly by tagging a v3.3 pre-release in master.

@mvdan
Copy link
Owner

mvdan commented Feb 3, 2021

Fixed now, with https://github.com/mvdan/sh/releases/tag/v3.3.0-0.dev:

$ docker run --rm mvdan/shfmt:latest --version
Unable to find image 'mvdan/shfmt:latest' locally
latest: Pulling from mvdan/shfmt
0f1463aa5a3d: Pull complete 
Digest: sha256:abf75a50be99bed27dda9a36fdd22b89dcaf6c90c953d2e07d29b87344143d4c
Status: Downloaded newer image for mvdan/shfmt:latest
v3.3.0-0.dev-34-g56c9918c

@mvdan mvdan closed this as completed Feb 3, 2021
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

2 participants