Closed adnaanbheda closed 2 years ago
This happens without docker push action as well, so I'm not sure what the problem is, maybe with buildx itself ?
# Use the action from the master, as we've seen some inconsistencies with @v1 # Issue: https://github.com/docker/build-push-action/issues/286 uses: docker/setup-buildx-action@master
What do you mean by "some inconsistencies"? v1
is a mutable tag that always points to the latest stable release. This is not recommended to use master
.
# Only worked for us with this option on 🤷♂️ with: install: true
How? installed
will only create an alias for docker build
so it will run docker buildx build
and will not be used by the build-push-action
anyway. I don't think it solves anything. Can you explain what it fixes on your side?
WARNING: local cache import at /tmp/.buildx-cache not found due to err: could not read /tmp/.buildx-cache/index.json: open /tmp/.buildx-cache/index.json: no such file or directory
Would need more logs from the build push action. I would say your cache folder has been tampered by something else. Can you add this step after the name: Cache Docker layers
one and give me the output?:
- name: Cache folder content
run: |
tree -f -pug -h -D /tmp/.buildx-cache
I have faced a similar error when trying to use local cache. As far as the code comments are concerned I believe the reporter was testing out the functionality from this blog article which is where the comments are coming from.
Closing as there is no relevant activity on this issue. Leave a comment if you have more information relative to https://github.com/docker/build-push-action/issues/608#issuecomment-1118526404. Thanks.
@crazy-max
We are alo running into this in one project only (Angular front-end). Relevant part of the config below, largely similar to this example.
Also, I have added the following:
- name: Cache folder content
run: |
tree -f -pug -h -D /tmp/.buildx-cache
And the output is just this, directory does not exist:
/tmp/.buildx-cache [error opening dir]
0 directories, 0 files
Interestingly, we are not having this issue with our other projects where configuration is almost identical. Any ideas what else we can do to troubleshoot?
is this issue solved? thanks a lot
Still having this issue..
I have the same issue
Interesting I'm seeing differences in the ci
#0 building with "builder-317bb61c-7b9a-4977-bc30-b54f9728d056" instance using docker-container driver
#1 [internal] load git source https://github.com/mozilla/addons-server.git#refs/pull/21893/merge
#1 0.125 Initialized empty Git repository in /var/lib/buildkit/runc-overlayfs/snapshots/snapshots/1/fs/
#1 1.218 e6fcbc1b7d3bee494da7246f83eb02822f0bec20 refs/pull/21893/merge
#1 2.350 From https://github.com/mozilla/addons-server
#1 2.350 * [new ref] refs/pull/21893/merge -> refs/pull/21893/merge
#1 DONE 4.2s
#2 [internal] load metadata for docker.io/library/python:3.10-slim-buster
#2 ...
#3 [auth] library/python:pull token for registry-1.docker.io
#3 DONE 0.0s
#2 [internal] load metadata for docker.io/library/python:3.10-slim-buster
#2 DONE 0.7s
#4 [internal] settings cache mount permissions
#4 DONE 0.0s
And the local logs
DOCKER_BUILDKIT=1 docker build -t test_amo --platform linux/amd64 --progress=plain -f ./Dockerfile.test --cache-to=type=local,dest=./docker-cache --cache-from=type=local,src=./docker-cache,mode=max --builder=container .
I understand this isn't 1:1 but I get
#7 importing cache manifest from local:11960011465921662817
#7 inferred cache manifest type: application/vnd.oci.image.index.v1+json done
#7 DONE 0.0s
This seems to be confirming that the cache mount is there, I don't get that log in CI.
I have same issue while using woodpecker buildx plugin https://woodpecker-ci.org/plugins/Docker%20Buildx
I have a following pipeline
- name: frontend:build-and-publish
image: woodpeckerci/plugin-docker-buildx:3.2.0
settings:
platforms: linux/amd64
repo: gitea.example.com/user/repo-name/frontend
tags_file:
- .tags
env_file:
- .build-env
registry: gitea.example.com
username: user
password:
from_secret: token
custom_dns:
- 10.10.10.1
- 8.8.8.8
context: ./repo-name-fe
dockerfile: repo-name-fe/Dockerfile
cache_from: type=local,src=/tmp/docker-cache
cache_to: type=local,dest=/tmp/docker-cache
which runs following
+ /usr/local/bin/dockerd --data-root /var/lib/docker --host=unix:///var/run/docker.sock --dns 10.10.10.1 --dns 8.8.8.8
Version: 2[5](https://cicd.example.com/repos/1/pipeline/5/6#L5).0.4
API version: 1.44
Go version: go1.21.8
Git commit: 1a57[6](https://cicd.example.com/repos/1/pipeline/5/6#L6)c5
Built: Wed Mar 6 16:32:02 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 25.0.4
API version: 1.44 (minimum version 1.24)
Go version: go1.21.8
Git commit: 061aa95
Built: Wed Mar 6 15:36:46 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.[7](https://cicd.example.com/repos/1/pipeline/5/6#L7).13
GitCommit: 7c3aca7a610df76212171d200ca3[8](https://cicd.example.com/repos/1/pipeline/5/6#L8)11ff60[9](https://cicd.example.com/repos/1/pipeline/5/6#L9)6eb8
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
+ /usr/local/bin/docker info
Client:
Version: 25.0.4
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.13.0
Path: /usr/local/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.24.7
Path: /usr/local/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 25.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: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 7c3aca7a6[10](https://cicd.example.com/repos/1/pipeline/5/6#L10)df76212171d200ca38[11](https://cicd.example.com/repos/1/pipeline/5/6#L11)ff6096eb8
runc version: v1.1.[12](https://cicd.example.com/repos/1/pipeline/5/6#L12)-0-g51d5e94
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 5.15.0-101-generic
Operating System: Alpine Linux v3.19
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.751GiB
Name: 2fcf41bd946c
ID: ec639642-b26d-4d33-b92b-3a69b1fbc120
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
+ /usr/local/bin/docker buildx create --use
clever_aryabhata
+ /usr/local/bin/docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
clever_aryabhata* docker-container
\_ clever_aryabhata0 \_ unix:///var/run/docker.sock inactive
default docker
\_ default \_ default running v0.12.5 linux/amd64, linux/386
+ /usr/local/bin/docker buildx build --rm=true -f repo-name-fe/Dockerfile ./repo-name-fe --pull=true --cache-from type=local,src=/tmp/docker-cache --cache-to type=local,dest=/tmp/docker-cache --build-arg DOCKER_IMAGE_CREATED=2024-03-20T23:33:56Z --build-arg SOURCE_DATE_EPOCH=1710977256 --output type=image,push=true,rewrite-timestamp=true --platform linux/amd64 -t gitea.example.com/myuser/repo-name/frontend:latest -t gitea.example.com/myuser/repo-name/frontend:0.1.2 -t gitea.example.com/myuser/repo-name/frontend:d847576 --label org.opencontainers.image.created=2024-03-20T23:33:50Z --label org.opencontainers.image.source=https://gitea.example.com/myuser/repo-name.git --label org.opencontainers.image.url=https://gitea.example.com/myuser/repo-name --label org.opencontainers.image.revision=d84757693e7189a5bbfae9c667e58c6[13](https://cicd.example.com/repos/1/pipeline/5/6#L13)4cc37d3
#0 building with "clever_aryabhata" instance using docker-container driver
#1 [internal] booting buildkit
#1 pulling image moby/buildkit:buildx-stable-1
#1 pulling image moby/buildkit:buildx-stable-1 [22](https://cicd.example.com/repos/1/pipeline/5/6#L22).9s done
#1 creating container buildx_buildkit_clever_aryabhata0
#1 creating container buildx_buildkit_clever_aryabhata0 0.8s done
#1 DONE [23](https://cicd.example.com/repos/1/pipeline/5/6#L23).6s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 7[70](https://cicd.example.com/repos/1/pipeline/5/6#L70)B done
#2 DONE 0.1s
[... steps logs ...]
#16 exporting to image
#16 exporting layers
#16 exporting layers 21.3s done
#16 rewriting layers with source-date-epoch 1710977256 (2024-03-20 23:27:36 +0000 UTC)
#16 rewriting layers with source-date-epoch 1710977256 (2024-03-20 23:27:36 +0000 UTC) 17.4s done
#16 exporting manifest sha256:b882daa29910a971f446bb49d3ed0b29f2d045be64dcda4742f5bc87a3c82fb5 0.0s done
#16 exporting config sha256:0b591a5f4ea7e1165dc3124ebcb0a2c78be0e4437dcb6e5b6894bb300e25ba73 0.0s done
#16 exporting attestation manifest sha256:18e5578173c7de0dc89fca3114491b84149147cf826e90ac7aedaad4b66442b2 0.0s done
#16 exporting manifest list sha256:e7692392632d993b8449dd8168f393ee82c268e43a43a84866062fc6f076c01c 0.0s done
#16 pushing layers
#16 ...
#17 [auth] *:: myuser/repo-name/frontend:pull,push token for gitea.example.com
#17 DONE 0.0s
#16 exporting to image
#16 pushing layers 1.2s done
#16 pushing manifest for gitea.example.com/myuser/repo-name/frontend:latest@sha256:e7692392632d993b8449dd8168f393ee82c268e43a43a84866062fc6f076c01c
#16 pushing manifest for gitea.example.com/myuser/repo-name/frontend:latest@sha256:e7692392632d993b8449dd8168f393ee82c268e43a43a84866062fc6f076c01c 0.1s done
#16 pushing layers 0.1s done
#16 pushing manifest for gitea.example.com/myuser/repo-name/frontend:0.1.2@sha256:e7692392632d993b8449dd8168f393ee82c268e43a43a84866062fc6f076c01c 0.0s done
#16 pushing layers 0.1s done
#16 pushing manifest for gitea.example.com/myuser/repo-name/frontend:d847576@sha256:e7692392632d993b8449dd8168f393ee82c268e43a43a84866062fc6f076c01c 0.0s done
#16 DONE 40.6s
#18 exporting cache to client directory
#18 preparing build cache for export
#18 writing layer sha256:0a31cd41b9386deacbfea8271ac595517861ae4af77fea38f586511e476a45c0
#18 writing layer sha256:0a31cd41b9386deacbfea8271ac595517861ae4af77fea38f586511e476a45c0 1.3s done
#18 writing layer sha256:3f72a72846173b6a02c1f73db9a74aca2af50fb39bf13ba2e4d12d13e5722d6c
#18 writing layer sha256:3f72a72846173b6a02c1f73db9a74aca2af50fb39bf13ba2e4d12d13e5722d6c 0.0s done
#18 writing layer sha256:4abcf20661432fb2d719aaf90656f55c287f8ca915dc1c92ec14ff61e67fbaf8 0.1s done
#18 writing layer sha256:7c215e7ef3945bd4fdac5a20f1e4a29c62f28c8493ad05d3e651d62cf069140d
#18 writing layer sha256:7c215e7ef3945bd4fdac5a20f1e4a29c62f28c8493ad05d3e651d62cf069140d 0.1s done
#18 writing layer sha256:ac94fbabe772e012cbc761da39548763cf63e9356e7db67427b5c86e2ff66674
#18 writing layer sha256:ac94fbabe772e012cbc761da39548763cf63e9356e7db67427b5c86e2ff66674 0.0s done
#18 writing layer sha256:bdd42133c604d646ca308b476ea000956ff9609dcb42c318d7f602f3fc966cc5
#18 writing layer sha256:bdd42133c604d646ca308b476ea000956ff9609dcb42c318d7f602f3fc966cc5 0.9s done
#18 writing layer sha256:c7835c9c0750cafd645efc0d33d45a43834bab99d437fee411b7482334ee6633
#18 writing layer sha256:c7835c9c0750cafd645efc0d33d45a43834bab99d437fee411b7482334ee6633 0.0s done
#18 writing layer sha256:ff171c16ee4e8ed3a0ae3edb6fb9558f281134a3879eedca7d79fc2e16e46073
#18 writing layer sha256:ff171c16ee4e8ed3a0ae3edb6fb9558f281134a3879eedca7d79fc2e16e46073 1.8s done
#18 writing config sha256:f3e63659748cbb197672e9a2eda3a455485e79797bc36c361abe75cc1e71c4c8
#18 writing config sha256:f3e63659748cbb197672e9a2eda3a455485e79797bc36c361abe75cc1e71c4c8 9.8s done
#18 writing cache manifest sha256:c731e3cc156b74ec199953d06008753e4ecadf9fb3722abcfc64ec01b5d64063
#18 preparing build cache for export 26.8s done
#18 writing cache manifest sha256:c731e3cc156b74ec199953d06008753e4ecadf9fb3722abcfc64ec01b5d64063 12.6s done
#18 DONE 26.8s
WARNING: local cache import at /tmp/docker-cache not found due to err: could not read /tmp/docker-cache/index.json: open /tmp/docker-cache/index.json: no such file or directory
This woodpecker-agent
is a docker service with following compose setup
services:
cicd:
image: woodpeckerci/woodpecker-server:latest
container_name: woodpecker-server
restart: unless-stopped
dns:
- 10.10.10.1
- 8.8.8.8
volumes:
- ./woodpecker-server-data:/var/lib/woodpecker/
environment:
- WOODPECKER_OPEN=$WOODPECKER_OPEN
- WOODPECKER_HOST=$WOODPECKER_HOST
- WOODPECKER_GITEA=$WOODPECKER_GITEA
- WOODPECKER_GITEA_URL=$WOODPECKER_GITEA_URL
- WOODPECKER_LOG_LEVEL=$WOODPECKER_LOG_LEVEL
- WOODPECKER_GITEA_CLIENT=$WOODPECKER_GITEA_CLIENT
- WOODPECKER_GITEA_SECRET=$WOODPECKER_GITEA_SECRET
- WOODPECKER_AGENT_SECRET=$WOODPECKER_AGENT_SECRET
woodpecker-agent:
container_name: woodpecker-agent
image: woodpeckerci/woodpecker-agent:latest
dns:
- 10.10.10.1
- 8.8.8.8
command: agent
restart: unless-stopped
depends_on:
- cicd
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- woodpecker-cache:/tmp/docker-cache
environment:
- WOODPECKER_SERVER=cicd:9000
- WOODPECKER_AGENT_SECRET=$WOODPECKER_AGENT_SECRET
volumes:
woodpecker-cache:
I mounted cache: woodpecker-cache:/tmp/docker-cache
I know that its different piece of software but it is still using same tool under the hood
Troubleshooting
Before submitting a bug report please read the Troubleshooting doc.
Behaviour
Steps to reproduce this issue
Expected behaviour
Should build the image
Actual behaviour
Throws a fatal error
WARNING: local cache import at /tmp/.buildx-cache not found due to err: could not read /tmp/.buildx-cache/index.json: open /tmp/.buildx-cache/index.json: no such file or directory
Configuration
Logs