Skip to content

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

Closed as not planned

Description

@danjamesmay

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.

Activity

  1. changed the title [-]Syntax directive failing behind corporate proxy[/-] on Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions