buildx: Changes to .dockerignore in 0.7.1 breaking my builds

Github action docker/setup-buildx-action recently updated buildx default version to 0.7.1

This introduced a bug in our build pipeline.

In our action, we first run docker compose up, which creates a volume at .data/db/mysql. Then, we build the image using buildx. The new parser is trying to read this folder when loading context, even though it is ignored.

Previous output (0.7.0):

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 1.03kB done
#1 DONE 0.0s

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

#3 [internal] load metadata for docker.io/library/node:16-alpine
#3 ...

#4 [auth] library/node:pull token for registry-1.docker.io
#4 DONE 0.0s

#3 [internal] load metadata for docker.io/library/node:16-alpine
#3 DONE 0.5s

#5 [builder 1/7] FROM docker.io/library/node:16-alpine@sha256:a9b9cb880fa429b0bea899cd3b1bc081ab7277cc97e6d2dcd84bd9753b2027e1
#5 resolve docker.io/library/node:16-alpine@sha256:a9b9cb880fa429b0bea899cd3b1bc081ab7277cc97e6d2dcd84bd9753b2027e1 done
#5 ...

#7 [internal] load build context
#7 transferring context: 3.85MB 0.2s done
#7 DONE 0.2s

Output for 0.7.1:

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 42B done
#1 ERROR: error from sender: open .data/db/mysql: permission denied
------
 > [internal] load build definition from Dockerfile:
------
error: failed to solve: failed to read dockerfile: error from sender: open .data/db/mysql: permission denied
Error: buildx failed with: error: failed to solve: failed to read dockerfile: error from sender: open .data/db/mysql: permission denied

Our .dockerignore:

node_modules
dist
docs
coverage
.ci
.github
.data
README.md
.vscode
scripts
.git

.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

Dockerfile
docker-compose.yml
docker

The following dockerignore is also broken:

**


!src

!.env*

!yarn.lock
!package.json
!.yarnrc.yml

!test
!jest.config.*

!nest-cli.json
!tsconfig*

!.eslintrc
!prettier.config.js

!.sentryclirc

.yarn/*
!.yarn/patches
!.yarn/sdks
!.yarn/versions
.pnp.*

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

It is private. I will try to create a repro later