-
Notifications
You must be signed in to change notification settings - Fork 563
Open
Description
When using docker build
with a Git repo as build context and DOCKER_BUILDKIT=1 the .dockerignore contents in the Git repo gets ignored and the files/directories get copied in the Docker image.
When DOCKER_BUILDKIT env is not set, the ignored files/directories are correctly excluded and can't be found in the Docker image.
Steps to reproduce the issue:
export DOCKER_BUILDKIT=1
docker build https://github.com/PHOENIX-MEDIA/buildkit-test.git
docker run -ti --rm <image> sh
ls -la /var/www/html/
The files in https://github.com/PHOENIX-MEDIA/buildkit-test/blob/master/.dockerignore shouldn't be in the html folder.
You can repeat the steps with a clone of the repository on your local machine:
git clone https://github.com/PHOENIX-MEDIA/buildkit-test.git .
docker build .
docker run -ti --rm <image> sh
ls -la /var/www/html/
The folder only contains thecopy.me
file, which is the expected result according to the .dockerignore contents.
I'm using Docker version 19.03.13, build 4484c46d9d on Centos7.
programmer04 and kirillsalikhov
Metadata
Metadata
Assignees
Labels
No labels