Skip to content

[archived] Docker build inside Codespaces used to confuse Dockerfiles unless you run touch Dockerfile first #38878

Discussion options

You must be logged in to vote

See answer below:

Hi from the Codespaces team 👋. Thanks for reporting this and providing a very clear minimal repro of the problem. I took a look, and this is a bug is Docker/Moby's BuildKit engine: moby/buildkit#1368. I don't think it's a codespaces-specific issue, but Codespace does enable BuildKit by default, which could explain why it happens in Codespaces.

Disabling the DOCKER_BUILDKIT environment variable is a good workaround (e.g. DOCKER_BUILDKIT=0 docker build -t d2 . in your example repo). You could also set a user-level or repo-level secret to set that environment variable on multiple codespaces.

Replies: 5 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@michielbdejong
Comment options

@michielbdejong
Comment options

Answer selected by michielbdejong
Comment options

You must be logged in to vote
3 replies
@jkeech
Comment options

@michielbdejong
Comment options

@jkeech
Comment options

Comment options

You must be logged in to vote
1 reply
@michielbdejong
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Codespaces Your development environment, in the cloud. Run VS Code and code on GitHub's cloud platform,
2 participants