The same dockerfile built and push by buildkitd and docker:
Dockerfile:
_FROM centos:centos7
COPY test.total.tgz /root/_
test.total.tgz is a pkg about 150M;
builkitd
run buildkitd with runc as worker;
buildctl .... --output type=image,name=test:0.0.1,push=true
=> exporting to image 46.5s
=> => exporting layers 8.5s
=> => exporting manifest sha256:63ff5acc68cb50a4d1bd613f6d7bdc3edfafd39c06c1 0.0s
=> => exporting config sha256:e614d8137014fcee833324a3dde6a84d813a7e2a379be1 0.0s
=> => pushing layers 37.5s
=> => pushing manifest for test:0.0.1 0.5s
The total time is about 46s;
Docker
docker build -f Dockerfile -t test:0.0.1 .
_=> exporting to image 1.2s
=> => exporting layers 1.2s
=> => writing image sha256:ac66482d1cbf65535512d4c3607a0fa95ff858a7b1ed94a8d74 0.0s
=> => naming to test:0.0.1 0.0s
time docker push test:0.0.1
_The push refers to repository [test]
e42b399ab8b7: Pushed
1113ccf1ca7d: Pushed
49bc294c3ae4: Layer already exists
388257de058b: Layer already exists
3d8b4cafda1d: Layer already exists
90a0151d4347: Layer already exists
f5b1e8ecaa86: Layer already exists
bca75dc8012f: Layer already exists
6038a3292cfd: Layer already exists
02852158a8f1: Layer already exists
e7f4df977e01: Layer already exists
5f70bf18a086: Layer already exists
2f4511388a8e: Layer already exists
3895c50d48c1: Layer already exists
79c7e168a304: Layer already exists
1009: digest: sha256:d6c82cb25d60b4c87db12ce7a3f78454696bc46d9508e96cc1b26dffb4acb0b3 size: 3891
real 0m28.171s
user 0m0.054s
sys 0m0.032s__
The total time is less than 30s
The export and push is much slower when use buildit directly than use docker build and docker push
The same dockerfile built and push by buildkitd and docker:
Dockerfile:
test.total.tgz is a pkg about 150M;
builkitd
run buildkitd with runc as worker;
buildctl .... --output type=image,name=test:0.0.1,push=true
=> exporting to image 46.5s
=> => exporting layers 8.5s
=> => exporting manifest sha256:63ff5acc68cb50a4d1bd613f6d7bdc3edfafd39c06c1 0.0s
=> => exporting config sha256:e614d8137014fcee833324a3dde6a84d813a7e2a379be1 0.0s
=> => pushing layers 37.5s
=> => pushing manifest for test:0.0.1 0.5s
The total time is about 46s;
Docker
docker build -f Dockerfile -t test:0.0.1 .
_=> exporting to image 1.2s
=> => exporting layers 1.2s
=> => writing image sha256:ac66482d1cbf65535512d4c3607a0fa95ff858a7b1ed94a8d74 0.0s
=> => naming to test:0.0.1 0.0s
time docker push test:0.0.1
_The push refers to repository [test]
e42b399ab8b7: Pushed
1113ccf1ca7d: Pushed
49bc294c3ae4: Layer already exists
388257de058b: Layer already exists
3d8b4cafda1d: Layer already exists
90a0151d4347: Layer already exists
f5b1e8ecaa86: Layer already exists
bca75dc8012f: Layer already exists
6038a3292cfd: Layer already exists
02852158a8f1: Layer already exists
e7f4df977e01: Layer already exists
5f70bf18a086: Layer already exists
2f4511388a8e: Layer already exists
3895c50d48c1: Layer already exists
79c7e168a304: Layer already exists
1009: digest: sha256:d6c82cb25d60b4c87db12ce7a3f78454696bc46d9508e96cc1b26dffb4acb0b3 size: 3891
real 0m28.171s
user 0m0.054s
sys 0m0.032s__
The total time is less than 30s
The export and push is much slower when use buildit directly than use docker build and docker push