Expected behavior
Skaffold calls docker build directly so that .dockerignore file is applied as expected, including whitelist rules like
**
!/.gitmodules
!/CMakeLists.txt
!/etc/**
!/CPlusPlusCode/**
!/submodules/**
which is the recommended approach – only sync what belongs to the build to avoid rebuilds.
Actual behavior
In the above .dockerignore example, only
.gitmodules
CMakeLists.txt
Dockerfile
get transmitted in the Docker context. Far from expectation.
Information
- Skaffold version: 0.34.1
- Operating system: macOS
- Contents of skaffold.yaml:
apiVersion: skaffold/v1beta13
kind: Config
build:
artifacts:
- image: skaffold-dockerignore-issue
docker: {}
tagPolicy:
gitCommit:
variant: AbbrevCommitSha
Steps to reproduce the behavior
See full example project at: https://github.com/AndiDog/skaffold-dockerignore-issue
Why this is important
Because builds are different in Skaffold vs. raw Docker CLI, and the good-practice whitelisting approach in .dockerignore is fully unusable.
Expected behavior
Skaffold calls
docker builddirectly so that .dockerignore file is applied as expected, including whitelist rules likewhich is the recommended approach – only sync what belongs to the build to avoid rebuilds.
Actual behavior
In the above .dockerignore example, only
get transmitted in the Docker context. Far from expectation.
Information
Steps to reproduce the behavior
See full example project at: https://github.com/AndiDog/skaffold-dockerignore-issue
Why this is important
Because builds are different in Skaffold vs. raw Docker CLI, and the good-practice whitelisting approach in .dockerignore is fully unusable.