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

Allow @sha256 digest for tags in FROM #541

Closed
stephenlawrence opened this issue Aug 19, 2016 · 3 comments
Closed

Allow @sha256 digest for tags in FROM #541

stephenlawrence opened this issue Aug 19, 2016 · 3 comments
Assignees

Comments

@stephenlawrence
Copy link

When I try to use a digest tag in my Dockerfile FROM: such as "FROM: mytomcat@sha256:b61b1b823ec66a2875c44572885fa332990b3aa0055ed50abf7f94837c9f7925" I get this:

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.15.14:build (docker-build) on project kestrel-docker: Execution docker-build of goal io.fabric8:docker-maven-plugin:0.15.14:build failed: Given repository name 'mytomcat@sha256:b61b1b823ec66a2875c44572885fa332990b3aa0055ed50abf7f94837c9f7925' is invalid:
[ERROR] * image part 'mytomcat@sha256' doesn't match allowed pattern '(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-][a-zA-Z0-9])(?:(?:.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-][a-zA-Z0-9]))+)?(?::[0-9]+)?/)?[a-z0-9]+(?:(?:[.]|__|[-])[a-z0-9]+)(?:/[a-z0-9]+(?:(?:[.]|__|[-])[a-z0-9]+))?'

I see various mentions in docker re: digest usage and our docker-compose.yml uses it just fine. Do the regex's need to be updated?

@stephenlawrence
Copy link
Author

Version 0.15.14

@rhuss
Copy link
Collaborator

rhuss commented Sep 1, 2016

Yes, seems to be a bug. The pattern where taken directly from Docker at that time, probably before digests where introduced.

The relevant spots are:

'will fix that, but cant promise when (have a busy week before me). If you feel fancy and need it earlier, we take also pull requests ;-)

@neelam-007
Copy link

i'm still seeing this problem - even with docker-maven-plugin v 0.22.1 - ?

io.fabric8:docker-maven-plugin:0.22.1:build (build) on project portal-enterprise: Execution build of goal io.fabric8:docker-maven-plugin:0.22.1:build failed: Given Docker name 'docker.io/jetty@sha256:82d64b324a80ac32b3f6412f2d9fb9fa0b7ade76f748b9f0fd1a9bde416f7adc' is invalid:
[ERROR] * image part 'jetty@sha256' doesn't match allowed pattern '[a-z0-9]+(?:(?:(?:[.]|__|[-]*)[a-z0-9]+)+)?(?:(?:/[a-z0-9]+(?:(?:(?:[.]|__|[-]*)[a-z0-9]+)+)?)+)?'
[ERROR] See http://bit.ly/docker_image_fmt for more details

Dockerfile:

FROM docker.io/jetty@sha256:82d64b324a80ac32b3f6412f2d9fb9fa0b7ade76f748b9f0fd1a9bde416f7adc

pulling directly from the command line works, but i need to build my docker image using dockerfile

@rohanKanojia rohanKanojia self-assigned this Nov 27, 2018
rohanKanojia added a commit to rohanKanojia/docker-maven-plugin that referenced this issue Nov 29, 2018
rohanKanojia added a commit to rohanKanojia/docker-maven-plugin that referenced this issue Dec 12, 2018
rhuss pushed a commit that referenced this issue Dec 12, 2018
mmkonrad added a commit to mmkonrad/docker-maven-plugin that referenced this issue Mar 18, 2019
ImageName.java and respective test class adjusted to be able to handle
image names with tag AND sha256 digest like:
image_name:image_tag@sha256<digest>

Signed-off-by: Marcus Konrad <M.M.Konrad@web.de>
mmkonrad added a commit to mmkonrad/docker-maven-plugin that referenced this issue Mar 19, 2019
ImageName.java and respective test class adjusted to be able to handle
image names with tag AND sha256 digest like:
image_name:image_tag@sha256<digest>

Signed-off-by: Marcus Konrad <M.M.Konrad@web.de>
rhuss pushed a commit that referenced this issue Apr 6, 2019
ImageName.java and respective test class adjusted to be able to handle
image names with tag AND sha256 digest like:
image_name:image_tag@sha256<digest>

Signed-off-by: Marcus Konrad <M.M.Konrad@web.de>
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

4 participants