microsoft / microsoft/vscode-remote-release

Can't disable BuildKit

Open
#6,856 9 comments 8 reactions 1 assignee View on GitHub

@chrmarti is already working on this.

Since Jul 4, 2022.

bug containers
Dominant language
Dockerfile
Stars
4.2k
Forks
470
Avg merge
1d 1h
Merged PRs (30d)
1

Description

TLDR: Looking for a way to disable buildx for devcontainer builds.

We're using the remote-containers plugin extensively here. I'm behind a notoriously difficult corporate proxy. It took a lot of work to get it to work properly behind our proxy while also being able to ignore the proxy to pull images / push images to/from our local registry. For about 2 years or so my devcontainers setup worked well.

We have multiple new devs starting, and as they start they end up with newer versions of docker than the one we've been using for 2 years (used to use 19.03.x, new devs are downloading newest version available which I think is 20.10.x. The new versions come with buildx by default. I also manually installed buildx yesterday for some multi-arch testing that I was doing.

I noticed today that the new devs as well as myself were unable to build/launch devcontainers. The errors seem to be a combination of permissions errors and known proxy-related errors (buildkit seems to ignore docker's proxy settings, another issue altogether...). I saw the buildx errors and thought it had something to do with a new VSCode update, considering it affected us all at once. After spending most of the day today troubleshooting this between meetings, I noticed that I can disable buildx (by taking the executable permissions off of the docker-buildx file in the libraries directory) and functionality goes back to normal.

I tried everything I can think of to soft-disable buildx for the devcontainers, but there just doesn't seem to be any way to do this. I tried setting DOCKER_BUILDKIT=0 in every possible way that the devcontainers allow you to change environment variables, and none of those had an affect (as they're all applied AFTER the docker build), I tried adding DOCKER_BUILDKIT to my bashrc, which was ignored, I tried running "docker buildx uninstall" to set the builder default back to docker, but still nothing. It seems like the devcontainers might be forcing buildkit whenever its installed.

I could use the workaround I mentioned above to disable buildx altogether, but after the aforementioned testing yesterday I'd actually like to use it for multi-arch containers so I'd rather only disable it for devcontainers if possible.

So my question is: Does anybody know a decent way to disable buildx/buildkit for devcontainer builds only, or alternatively is there a way that anybody knows of to fix proxy settings for buildkit? I was able to get buildx working through thte proxy yesterday but it involved making a custom buildkit image and passing that to the buildx create command, which doesn't really seem to be an option for devcontainer builds.

Thanks in advance!!

Environment: CentOS 7.9, 16 GB RAM, 4 CPU Cores

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.