moby: ERROR: failed to build resolver: passthrough: received empty target in Build()
Description
since I updated docker I get the above error whenever I try to run docker build
Reproduce
create an arbitrary Dockerfile
run docker build .
ERROR: failed to build resolver: passthrough: received empty target in Build()
Expected behavior
It should build the image
docker version
Client: Docker Engine - Community
Version: 24.0.4
API version: 1.43
Go version: go1.20.5
Git commit: 3713ee1
Built: Fri Jul 7 14:50:57 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 24.0.4
API version: 1.43 (minimum version 1.12)
Go version: go1.20.5
Git commit: 4ffc614
Built: Fri Jul 7 14:50:57 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.21
GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc:
Version: 1.1.7
GitCommit: v1.1.7-0-g860f061
docker-init:
Version: 0.19.0
GitCommit: de40ad0
docker info
Client: Docker Engine - Community
Version: 24.0.4
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.11.1
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.19.1
Path: /usr/libexec/docker/cli-plugins/docker-compose
scan: Docker Scan (Docker Inc.)
Version: v0.23.0
Path: /usr/libexec/docker/cli-plugins/docker-scan
Server:
Containers: 47
Running: 6
Paused: 0
Stopped: 41
Images: 14
Server Version: 24.0.4
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc version: v1.1.7-0-g860f061
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
Kernel Version: 5.15.0-78-generic
Operating System: Ubuntu 20.04.6 LTS
OSType: linux
Architecture: x86_64
CPUs: 16
Total Memory: 31.27GiB
Name: russell-workstation
ID: 14e2a789-c6d2-4a7e-92e2-293b93e0abe5
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Additional Info
running other commands (docker run etc) works
also running docker build with sudo works.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 5
- Comments: 26 (11 by maintainers)
I ran into the same error message. Adding the protocol
otlp://to the OTEL_EXPORTER_OTLP_TRACES_ENDPOINT env var solved it for me.I was having a similar problem, getting the exact same error message:
After a lot of experimenting with
sudoand environment variables I found thatOTEL_EXPORTER_OTLP_ENDPOINTbeing set was the culprit (in my case). Unsetting it got rid of the error anddocker buildstarted working.UPDATE I wanted to give an update regarding my issue so that you’re not looking into something that isn’t worth it.
I was doing all my tests in a specific repo folder and I was explicitly providing different kinds of environment files in the docker compose configuration.
However, I also had a
.envenv that contained config to be picked up from an other plugin I had and this hadOTEL_EXPORTER_OTLP_ENDPOINTin it… I had simply forgotten thedocker composeautomatically picks up.envfiles…As soon as I removed it, everything worked as expected
Sorry for the trouble!
Yes, I assume the default should work. But perhaps my assumption (compose setting a value) is incorrect; I asked in our internal slack if the compose team could have a peek if it’s possible related (or not).
I am having a quite similar issue.
Currently running Docker Desktop v.4.26.1 (131620) on Apple Silicon M2 Pro on MacOS: 14.2.1
While I can run
docker builddirectly using a Dockerfile, if I try to usedocker compose buildto build the same Dockerfile, I get the samefailed to build resolver: passthrough: received empty target in Build()errorThe docker compose file is as simple as it gets:
The funny thing is that if I zero the OTEL variable the command works
OTEL_EXPORTER_OTLP_ENDPOINT="" docker compose buildPlease note that I do not have the
OTEL_EXPORTER_OTLP_ENDPOINTset in my environment by defaultHere is the output of the
docker info@biffen unsetting that fixes it for me too. Thanks!