question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

devcontainer.json features break build when used with latest dockerfile syntax

See original GitHub issue

Devcontainer 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:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chrmarticommented, Oct 10, 2022

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.

1reaction
pariskcommented, Oct 7, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dev Container Features - Visual Studio Code
Development containers are a great way to simplify environment set up - they provide a complete coding environment with the tools your project ......
Read more >
Buildkit support at devcontainer.json level #1409 - GitHub
I assume you are using dockerComposeFile in .devcontainer/devcontainer.json then? I tested only with build.dockerfile so far. And indeed.
Read more >
Visual Studio Code and Dev Containers - stuartleeks.com
My team has been using dev containers quite heavily for the last few ... Dev containers for CI builds; What should go in...
Read more >
Dev Container metadata reference
The devcontainer.json file contains any needed metadata and settings required to configurate a development container for a given well-defined tool and ...
Read more >
Developing inside a Container - vscode-docs-arc
It allows you to open any folder inside (or mounted into) a container and take advantage of Visual Studio Code's full feature set....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found