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

Extension removes syntax=docker/dockerfile:1 annotation from Dockerfile #7463

Closed
asandroq opened this issue Nov 4, 2022 · 6 comments · Fixed by devcontainers/cli#271
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded
Milestone

Comments

@asandroq
Copy link

asandroq commented Nov 4, 2022

  • VSCode Version: 1.73.0

  • Local OS Version: macOS Monterrey

  • Remote OS Version: (image is not built)

  • Remote Extension/Connection Type: Containers

  • Logs:

    [2022-11-04T11:31:58.784Z] Start: Run: docker inspect --type image mcr.microsoft.com/vscode/devcontainers/base
    [2022-11-04T11:31:58.828Z] Stop (44 ms): Run: docker inspect --type image mcr.microsoft.com/vscode/devcontainers/base
    [2022-11-04T11:31:59.050Z] local container features stored at: /Users/alex/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/node_modules/vscode-dev-containers/container-features
    [2022-11-04T11:31:59.051Z] Start: Run: tar --no-same-owner -x -f -
    [2022-11-04T11:31:59.092Z] Stop (41 ms): Run: tar --no-same-owner -x -f -
    [2022-11-04T11:31:59.094Z] Start: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/s_/c3cq_h5x55xgm34fxmg5j3m80000gq/T/devcontainercli/container-features/0.23.2-1667561519050/Dockerfile-with-features -t vsc-vscode-devcontainer-9cfe64ce87b952b7309f82b6701504c5 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label <dir>
    [2022-11-04T11:31:59.388Z] [+] Building 0.0s (0/0)                                                         
    [2022-11-04T11:31:59.490Z] [+] Building 0.0s (0/1)                                                         
     => [internal] load build definition from Dockerfile-with-features         0.0s
     => => transferring dockerfile:                                            0.0s
    [2022-11-04T11:31:59.560Z] [+] Building 0.1s (2/2) FINISHED                                                
     => [internal] load build definition from Dockerfile-with-features         0.0s
     => => transferring dockerfile: 7.65kB                                     0.0s
     => [internal] load .dockerignore                                          0.0s
     => => transferring context: 2B                                            0.0s
    [2022-11-04T11:31:59.561Z] ERROR: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 9: unknown instruction: SET
    [2022-11-04T11:31:59.568Z] Stop (474 ms): Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/s_/c3cq_h5x55xgm34fxmg5j3m80000gq/T/devcontainercli/container-features/0.23.2-1667561519050/Dockerfile-with-features -t vsc-vscode-devcontainer-9cfe64ce87b952b7309f82b6701504c5 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label <dir>/.devcontainer
    [2022-11-04T11:31:59.568Z] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/s_/c3cq_h5x55xgm34fxmg5j3m80000gq/T/devcontainercli/container-features/0.23.2-1667561519050/Dockerfile-with-features -t vsc-vscode-devcontainer-9cfe64ce87b952b7309f82b6701504c5 --target dev_containers_target_stage --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label <dir>/.devcontainer
    [2022-11-04T11:31:59.568Z]     at doe (/Users/alex/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1888:1635)
    [2022-11-04T11:31:59.568Z]     at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    [2022-11-04T11:31:59.568Z]     at async pF (/Users/alex/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1887:1973)
    [2022-11-04T11:31:59.568Z]     at async eT (/Users/alex/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1887:901)
    [2022-11-04T11:31:59.569Z]     at async voe (/Users/alex/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1893:2049)
    [2022-11-04T11:31:59.569Z]     at async Xf (/Users/alex/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1893:3212)
    [2022-11-04T11:31:59.569Z]     at async Jae (/Users/alex/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:2013:15058)
    [2022-11-04T11:31:59.569Z]     at async Wae (/Users/alex/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:2013:14812)
    

Steps to Reproduce:

  1. Use a Dockerfile with the # syntax=docker/dockerfile:1 annotation at the top for the dev container
  2. Try to build a dev container with the Dockerfile created above
  3. This extension will strip the annotation given above when creating the file Dockerfile-with-features
  4. Building the Docker image will fail.

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Nov 4, 2022
@sylver
Copy link

sylver commented Nov 4, 2022

I came here to report the very same issue, unable to start a devcontainer with a Dockerfile using this annotation.

Seems related to a longstanding issue tracked by #7318 and #6848

@jnewland
Copy link

jnewland commented Nov 7, 2022

I'm experiencing the same symptoms when rebuilding an existing devcontainer / Codespace that uses a Dockerfile with a # syntax=docker/dockerfile:1.4 header. My configuration includes zero features specified in devcontainer.json.

@oinopion
Copy link

oinopion commented Nov 7, 2022

I'm also experiencing the regression with v0.262.3 and v0.263.0 versions. Last working version is: v0.255.4.

chrmarti added a commit to devcontainers/cli that referenced this issue Nov 8, 2022
chrmarti added a commit to devcontainers/cli that referenced this issue Nov 9, 2022
@chrmarti chrmarti self-assigned this Nov 9, 2022
@chrmarti chrmarti added the bug Issue identified by VS Code Team member as probable bug label Nov 9, 2022
@chrmarti chrmarti added this to the November 2022 milestone Nov 9, 2022
@chrmarti
Copy link
Contributor

chrmarti commented Nov 9, 2022

There is a fix in 0.262.3 and 0.263.0-pre-release addressing the issue when there are features configured in the devcontainer.json. That missed the code path when there are no features, fixing this here.

@chrmarti
Copy link
Contributor

This fix is available in Dev Containers 0.264.0-pre-release. Let me know if that fixes this issue for you. Thanks.

@asandroq
Copy link
Author

@chrmarti Yes, it seems to be fixed. Thank you!

@chrmarti chrmarti added the verified Verification succeeded label Nov 15, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants