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

Syntax directive failing behind corporate docker mirror (e.g. artifactory) #751

Closed
danjamesmay opened this issue Feb 13, 2024 · 0 comments
Closed

Comments

@danjamesmay
Copy link

danjamesmay commented Feb 13, 2024

I have the following error, running the devcontainer cli on @devcontainers/cli 0.56.0. Node.js v20.11.0. linux 5.15.133.1-microsoft-standard-WSL2 x64., which appears to stem from here:

useBuildKitBuildContexts && !(imageBuildInfo.dockerfile && supportsBuildContexts(imageBuildInfo.dockerfile)) ? '# syntax=docker/dockerfile:1.4' :

 => ERROR resolve image config for docker.io/docker/dockerfile:1.4                                                              0.1s
------
 > resolve image config for docker.io/docker/dockerfile:1.4:
------
Dockerfile-with-features:1
--------------------
   1 | >>> # syntax=docker/dockerfile:1.4
   2 |     ARG _DEV_CONTAINERS_BASE_IMAGE=placeholder
   3 |     FROM <my_corp_mirror>/library/golang:1.20-bullseye AS dev_container_auto_added_stage_label
--------------------
ERROR: failed to solve: failed to authorize: failed to fetch anonymous token: Get "https://auth.docker.io/token?scope=repository%3Adocker%2Fdockerfile%3Apull&service=registry.docker.io": Forbidden

I worked around this by adding the --buildkit never option to the build command, but this isn't ideal for futureproofing.

I can see there appears to be a new flag for a related issue here: #728, which adds a hidden --omit-syntax-directive flag. When will this be released?

I believe anyone who works with the devcontainer cli behind a corporate docker mirror like artifactory will be blocked by this issue until the workaround is provided. It appears the syntax comment goes off to the public docker.io site to get whatever the directive provides and as this is not configurable. I can go off to get this image with docker pull <corp_mirror>/docker/dockerfile:1.4.0, but obvs the syntax directive isn't configurable so I can't make this work.

@danjamesmay danjamesmay changed the title Syntax directive failing behind corporate proxy Syntax directive failing behind corporate docker mirror (e.g. artifactory) Feb 13, 2024
@danjamesmay danjamesmay closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2024
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

1 participant