devcontainer.json features break build when used with latest dockerfile syntax
See original GitHub issueDevcontainer container features builder, removes dockerfile syntax at the first line breaking the build when using docker’s latest features like “COPY --link”.
Thrown error:
[2022-09-17T02:42:13.445Z] => [internal] load build definition from Dockerfile-with-features 0.2s
=> => transferring dockerfile: 5.32kB 0.0s
=> [internal] load .dockerignore 0.3s
=> => transferring context: 2B 0.0s
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: dockerfile parse error line 105: Unknown flag: link
Possible root of the issue: https://github.com/devcontainers/cli/blob/main/src/spec-node/containerFeatures.ts https://github.com/devcontainers/cli/blob/596544a1a75248aaaf0b7174777828665a788f56/src/spec-node/containerFeatures.ts#L50 https://github.com/devcontainers/cli/blob/596544a1a75248aaaf0b7174777828665a788f56/src/spec-node/containerFeatures.ts#L223-L224
devcontainer.json:
{
...
"features": {},
...
}
Dockerfile:
# syntax=docker/dockerfile:1
COPY --link ./dummy/ /dummy/
...
generated /tmp/vsch-*/container-features/0.251.0-*/Dockerfile-with-features:
ARG _DEV_CONTAINERS_BASE_IMAGE=placeholder
...
– More on “COPY --link”: https://www.howtogeek.com/devops/how-to-accelerate-docker-builds-and-optimize-caching-with-copy-link/
about vscode:
Version: 1.71.2
Commit: 74b1f979648cc44d385a2286793c226e611f59e7
Date: 2022-09-14T21:12:14.256Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.15.0-1019-azure snap
Sandboxed: No
docker info:
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Docker Buildx (Docker Inc., v0.9.1-docker)
compose: Docker Compose (Docker Inc., v2.10.2)
scan: Docker Scan (Docker Inc., v0.17.0)
Server:
Containers: 26
Running: 8
Paused: 0
Stopped: 18
Images: 105
Server Version: 20.10.18
...
*opening devcontainer via ssh
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Working on a fix. Please see https://github.com/microsoft/vscode-remote-release/issues/6848#issuecomment-1273459194 and give 0.258.0-pre-release a try. Thanks.
We are running into this issue as well, which is pretty much ruining all our devcontainer setups in the company. I understand a fix might take a while to ship, but since we need this to work day-to-day, is there any workaround for this?
Thanks a lot.