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

Features implementation breaks buildkit Dockerfile by stripping # syntax=docker/dockerfile:1 line #209

Closed
davecardwell opened this issue Oct 9, 2022 · 1 comment

Comments

@davecardwell
Copy link

davecardwell commented Oct 9, 2022

I have a .devcontainer/Dockerfile using buildkit with the starting line, # syntax=docker/dockerfile:1. It has been working for the past several versions of vscode. Since updating to v1.72.0 my devcontainer fails to run.

When starting my devcontainer, vscode runs:
docker-compose --project-namemyproject -f /path/to/compose.yaml -f /Users/me/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/docker-compose/docker-compose.devcontainer.build-1665287802265.yml build

That generated config file looks like:

services:
  devcontainer:
    build:
      dockerfile: /var/folders/zf/3lppq14565594kgv2_7chsx40000gn/T/devcontainercli/container-features/0.19.0-1665287801705/Dockerfile-with-features
      target: dev_containers_target_stage
      args:
        - BUILDKIT_INLINE_CACHE=1
        - _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label
        - _DEV_CONTAINERS_IMAGE_USER=root
        - _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp

And the dockerfile it references is a modified copy of my original Dockerfile, however the # syntax=docker/dockerfile:1 has been stripped, resulting in the 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 13: unknown instruction: SET

Modifying the referenced Dockerfile-with-features and adding back in the # syntax=docker/dockerfile:1 allows the build command to proceed from the command line, however vscode will generate a different set of paths if I try to build the container in-app so the issue will repeat.

The specific part of my Dockerfile it is choking on without the # syntax line is a RUN heredoc: https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/

Note that I am not actually using Features in my devcontainer.json.

Apologies if this is better suited in the vscode Issues—please direct me to the appropriate repository.

Version: 1.72.0
Commit: 64bbfbf67ada9953918d72e1df2f4d8e537d340e
Date: 2022-10-04T23:19:55.212Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin arm64 21.6.0
Sandboxed: No

Dev Containers: v0.255.2


Docker desktop: macOS 4.12.0 (85629)
Engine: 20.10.17
Compose: v2.10.2
@davecardwell
Copy link
Author

Closing in favor of microsoft/vscode-remote-release#6848

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