Skip to content

Provide version information through labels#1256

Merged
fbartels merged 5 commits intodocker-mailserver:masterfrom
fbartels:labels
Oct 23, 2019
Merged

Provide version information through labels#1256
fbartels merged 5 commits intodocker-mailserver:masterfrom
fbartels:labels

Conversation

@fbartels
Copy link
Copy Markdown
Member

@fbartels fbartels commented Sep 9, 2019

Can be retrieved by calling e.g. docker inspect tvial/docker-mailserver:testing

Sample output:

$ docker inspect -f '{{ range $k, $v := .ContainerConfig.Labels -}}
> {{ $k }}={{ $v }}
> {{ end -}}' tvial/docker-mailserver:testing
maintainer=Thomas VIAL
org.label-schema.description=A fullstack but simple mailserver (smtp, imap, antispam, antivirus, ssl...)
org.label-schema.name=docker-mailserver
org.label-schema.schema-version=1.0
org.label-schema.url=https://github.com/tomav/docker-mailserver
org.label-schema.vcs-ref=7580aec
org.label-schema.vcs-url=https://github.com/tomav/docker-mailserver
org.label-schema.version=v6.1.0-111-g7580aec

@erik-wramner
Copy link
Copy Markdown
Contributor

Looks good but I have one question. If the docker images are built from docker hub and not from Travis then they will just run the Dockerfile and ignore our Makefile. In that case your changes will do nothing except when we build manually.

@fbartels
Copy link
Copy Markdown
Member Author

fbartels commented Sep 9, 2019

Ah, yes indeed. At this point in time the build args would not be passed and the values would be empty in the resulting image.

It seems this can be mitigated through build hooks (https://docs.docker.com/docker-hub/builds/advanced/). Currently have a test build running. Will push the required hook if my change succeeds.

Edit: I should add that this "breaks" build layer caching as the values passed as build arguments will be changing quite often (everytime you make a git commit). So it could be an idea to have just one make build.

Edit2: hook can be tested by running DOCKERFILE_PATH=./Dockerfile IMAGE_NAME=docker-mailserver hooks/build in the root of the project.

@erik-wramner
Copy link
Copy Markdown
Contributor

No rush or anything, I just want to check that you are not waiting for me on this and/or your other PRs?

@fbartels
Copy link
Copy Markdown
Member Author

It seems we both forgot about this. Let me rebase, wondering about some of the Makefile changes, though.

Can be retrieved by calling e.g. `docker inspect -f {{.Config.Labels}} tvial/docker-mailserver:testing`

Signed-off-by: Felix Bartels <[email protected]>
build args invalidate build cache already

Signed-off-by: Felix Bartels <[email protected]>
Signed-off-by: Felix Bartels <[email protected]>
Signed-off-by: Felix Bartels <[email protected]>
@erik-wramner
Copy link
Copy Markdown
Contributor

Right. If you are waiting for me on something, please just leave a comment.

@fbartels
Copy link
Copy Markdown
Member Author

@erik-wramner is not ok 198 checking setup.sh: setup.sh email add and login a known failure?

@erik-wramner
Copy link
Copy Markdown
Contributor

Yes, it happens every now and then.

@fbartels
Copy link
Copy Markdown
Member Author

fbartels commented Oct 23, 2019

OK, after regriggering tests are green. Let's merge.

@fbartels fbartels merged commit 7ff9764 into docker-mailserver:master Oct 23, 2019
@fbartels fbartels deleted the labels branch October 23, 2019 09:22
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

Successfully merging this pull request may close these issues.

2 participants