cli: cannot write /tmp/tmp4phcyxn2 because server did not provide an image ID
Description
Build fails with error:
cannot write /tmp/tmp4phcyxn2 because server did not provide an image ID
$ CACHE_FROM=27d861591f4da977a04e94431f1fce214485f293 COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose build --progress=plain --build-arg BUILDKIT_INLINE_CACHE=1
Native build is an experimental feature and could change at any time
Building app-frontend
WARNING: Error loading config file: .dockercfg: $HOME is not defined
WARNING: Error loading config file: .dockercfg: $HOME is not defined
#1 [internal] load build definition from Dockerfile
#1 sha256:bfa4b15feec4aff66a56da2fffc697555bf3abd42288cdb47fe7d6e146e43d25
#1 transferring dockerfile: 1.98kB done
#1 DONE 0.5s
#2 [internal] load .dockerignore
#2 sha256:c8a814244b123e69ef5bdbc269631c12cdf20bed9340d85934d92a5b7b8c249f
#2 transferring context: 114B done
#2 DONE 0.4s
....
....
...
#33 158.8 webpack 5.9.0 compiled with 17 warnings in 153155 ms
#33 159.2 Done in 158.35s.
#33 DONE 159.4s
cannot write /tmp/tmp4phcyxn2 because server did not provide an image ID
Steps to reproduce the issue:
- building images parallel with docker compose
Describe the results you received: Docker compose fail to build
Describe the results you expected: either success or provide a meaningful error message
Additional information you deem important (e.g. issue happens only occasionally):
the issue doesn’t occur on every build
we use jenkins as our ci
and some of the build are failing. not all, not even most. but we have 10s of failures per day (out of hundreds)
Output of docker version
:
WARNING: Error loading config file: .dockercfg: $HOME is not defined
Client: Docker Engine - Community
Version: 20.10.2
API version: 1.41
Go version: go1.13.15
Git commit: 2291f61
Built: Mon Dec 28 16:17:29 2020
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.2
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 8891c58
Built: Mon Dec 28 16:15:23 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.3
GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc:
Version: 1.0.0-rc92
GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Output of docker info
:
Client:
Context: default
Debug Mode: false
Plugins:
app: Docker App (Docker Inc., v0.9.1-beta3)
buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 17
Server Version: 20.10.2
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
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 io.containerd.runtime.v1.linux runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.4.0-1121-aws
Operating System: Ubuntu 16.04.7 LTS
OSType: linux
Architecture: x86_64
CPUs: 32
Total Memory: 58.97GiB
Name: ip-172-29-38-181
ID: 52OS:AMCC:AUGD:EYU4:SQAP:3FUE:2OF7:LJMH:IWMF:VAAB:K7TG:XR3S
Docker Root Dir: /mnt/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
registry.internal.****.io:5000
127.0.0.0/8
Live Restore Enabled: false
WARNING: No swap limit support
Additional environment details (AWS, VirtualBox, physical, etc.): AWS, ubuntu, running jenkins
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 47
- Comments: 47 (11 by maintainers)
Got this issue with Docker Desktop for Mac, went to preferences -> resources and increased the memory, after that the error dissapeared.
I have installed
buildx
using commanddocker buildx install
. After that problem disappeared.Same issue here
we have another insight, worth mentioning in some cases when this error occurs, it throws the same error in multiple images builds at once, at the end of each build. so in the same pipeline run, we have several successful builds and some failed builds of different images.
here’s an example for such case build1:
another image build failure at the same run:
Aren’t you running out of disk space? I just got this on my end (locally) but docker-compose had filled my SSD.
it’s not reproducible at all. it happens occasionally. and not in our local env. only in our CI and it’s a private repo as well but i can share more logs from the build. (not that they are so meaningful as i shared the important parts)
@aliabbasjaffri I hit the similar issue after I enabled the
docker desktop
beta features,Use containrd for pulling and storing images
. After I disable it, then I don’t have this problem anymore.This is my
docker version
Setting env var COMPOSE_DOCKER_CLI_BUILD=0 for docker-compose build command helped.
docker-compose version 1.29.1, build c34c88b2 (from Docker for Mac) Docker server version (via docker machine): v1.12.3 (very old)
Downgrading
docker-compose
to version1.27.4
fixes the issue.I’m facing the same issue, I’m using Jenkins as a kubernetes pod so I had to use DinD(
docker-in-docker
container) as a sidecar for Jenkins to build docker images.Docker build
works perfectly fine, but when I started usingdocker-compose
I see this issue consistently.docker-compose.yaml:
Build Log
Please let me know if you think anything causing issue here.
I solve my problem after I clean up my memory. As you can see I am out of memory.
I have the same issue. I run a jenkins job that run a docker-compose build on an ec2 with 16 GB memory, ( I use jenkins ec2 plugin, only one executer per ec2 instance) its hard to believe that its a memory issue.
@thaJeztah @docker Do we have any work arounds / solutions for this issue?
The issue above is secondary to another issue we experience. At the same time this happens in some builds:
cannot write /tmp/tmp_bc9imzl because server did not provide an image ID
we immediately suffer from a cache issue. the issue is that an image is being written with the wrong outputs. and it actually missing files from the original build. it happens to the same image all the time.any update on this?