Sample Header Ad - 728x90

How to view the full docker compose build log? daemon.json is ignored

5 votes
1 answer
4128 views
I want to debug a failing docker compose build --no-cache (it succeeds with the cache), however due to the log limit, I cannot see the reason for the failure, only the message output clipped, log limit 1MiB reached. Following the Docker documentation, I created the following /etc/docker/daemon.json:
{
  "features": { "buildkit": true },
  "log-driver": "local",
  "log-opts": 
  {
    "max-size": "100m",
    "max-file": "3"
  }
}
After systemctl docker restart, docker info shows:
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
  compose: Docker Compose (Docker Inc., 2.6.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: local
 Cgroup Driver: systemd
 Cgroup Version: 2
 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: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1.m
 runc version: 
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.18.5-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.41GiB
 Name: konradspc
 ID: 6NFV:RQP7:V6XK:7D6Z:W2LC:LPGR:HQBQ:V55P:BECL:WXPP:YPC5:2QQ2
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/ 
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
Notably, the logging driver is now shown as "local", where before it was "json-file", so it seems to me as if Docker is successfully loading /etc/docker/daemon.json. However when I execute docker compose build --no-cache again, I still get the message output clipped, log limit 1MiB reached. How do I get docker compose to not ignore daemon.json or is there any other way to access the full build log? I am using Docker version 20.10.17, build 100c70180f, Docker Compose version 2.6.0 with BuildKit on Arch Linux with Kernel 5.18.5. BuildKit cannot be deactivated because the build uses --mount=type=cache,target=/root/.m2 to cache Maven dependencies.
Asked by Konrad Höffner (1028 rep)
Jun 22, 2022, 09:44 AM
Last activity: Apr 19, 2025, 06:01 PM