I’m hitting a bit of a wall with a seemingly trivi...
# general
l
I’m hitting a bit of a wall with a seemingly trivial Docker image build. I have a Go binary target which I’m trying to toss into a Docker image, and when running
pants package
I get the following out of the subprocess stderr:
Copy code
ERROR: use `docker --context=default buildx` to switch to context "default"
I’m not seeing much in the pants log that looks weird, and a cursory google search suggests that this problem is normally related to the
DOCKER_HOST
or
DOCKER_CONTEXT
env vars. I’m using pants v.216.0, and docker desktop on OSX; v4.21.1 (docker engine 24.0.2). Here’s a
-ldebug
full output: https://gist.github.com/jcrumb-u21/b2836d74bd70d551f0b06ee90e2aaf19 and my full Dockerfile: https://gist.github.com/jcrumb-u21/dd907855b89fa6730e55fb27f829d1f4. I can see that the dependency inference is working and my Go binary is being built at least which is pretty sweet!
1
1
h
This happened to me when I updated my Docker. When I downgrade it to 4.20.1 worked normally, as far as I can recall.
l
Yeah, that’s worked for me as well. Engine version didn’t change, so it must be something about Docker Desktop itself. Classic.
Thank you!
Actually, looking at the release notes it’s probably the inclusion of
Buildx v0.11.0
in the 4.21.X branch
p
This happened to me, too. I fixed it by running
docker context use default
. Seems like a change introduced by docker.
👍 1
🎉 1
l
Good tip; that fixed the issue for me on 4.21.1 as well (our MDM automatically upgraded my Docker again in the background 🙄)