ResolveImageConfig takes 70.1s to complete

Open
#3,672 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker, go

Research direction

Reproduce the report with the supplied Dockerfile, Docker Engine 23.0.1, and BUILDKIT enabled, measuring the resolve image config step. Trace the image-config resolution path to identify why the cached Dockerfile frontend takes about 70 seconds; done means repeated builds avoid that delay and the behavior is covered by an appropriate regression test.

Written by the indexing model from the issue text.

Description

I enabled BUILDKIT, after a successful build image, the first step of building again does not use caching and is very slow.
resolve image config takes 70 seconds!

console
[internal] load .dockerignore
#2 transferring context: 125B done
#2 DONE 0.0s

#3 resolve image config for docker.io/docker/dockerfile:1.5.2@sha256:39b85bbfa7536a5feceb7372a0817649ecb2724562a38360f4d6a7782a409b14
#3 DONE 70.1s

#4 docker-image://docker.io/docker/dockerfile:1.5.2@sha256:39b85bbfa7536a5feceb7372a0817649ecb2724562a38360f4d6a7782a409b14
#4 CACHED

#5 [internal] load metadata for docker.io/library/openjdk:8-jdk-buster
#5 DONE 0.0s

#6 [internal] load metadata for docker.io/library/maven:3.6.3-openjdk-8
#6 DONE 0.0s

#7 [builder 1/6] FROM docker.io/library/maven:3.6.3-openjdk-8
#7 DONE 0.0s
Dockerfile
# syntax=docker/dockerfile:1.5.2@sha256:39b85bbfa7536a5feceb7372a0817649ecb2724562a38360f4d6a7782a409b14
FROM maven:3.6.3-openjdk-8 AS builder
WORKDIR /build
COPY . .
RUN --mount=target=/root/.m2,type=cache \
    mvn package -Dmaven.test.skip=true

FROM openjdk:8-jdk-buster
WORKDIR /server
COPY --from=builder /build/target/app.jar ./app.jar
CMD ["java","-jar","app.jar"]
docker version
Client: Docker Engine - Community
 Version:           23.0.1
 API version:       1.42
 Go version:        go1.19.5
 Git commit:        a5ee5b1
 Built:             Thu Feb  9 19:47:01 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          23.0.1
  API version:      1.42 (minimum version 1.12)
  Go version:       go1.19.5
  Git commit:       bc3805a
  Built:            Thu Feb  9 19:47:01 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.18
  GitCommit:        2456e983eb9e37e47538f59ea18f2043c9a73640
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 23h
Merged PRs (30d)
48

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.

More from moby/buildkit

All issues in moby/buildkit

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.