GoogleContainerTools / GoogleContainerTools/skaffold
build can not use dockerfiles out of the docker context
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
`skaffold build` will complain with:
```text
Error response from daemon: forbidden path outside the build context: ../platform/microservice/python3.9-poetry-microservice.dockerfile (). Docker build ran into internal error. Please retry.
If this keeps happening, please open an issue..
```
### Expected behavior
Skaffold should be able to map the configuration to `docker build my-app/ -f platform/microservice/python3.9-poetry-microservice.dockerfile` (even not sure why skaffold is using dockerfile path relative to the context, the documentation says that it is relative to the workspace)
### Actual behavior
Skaffold is failing complaining with an error message indicating the dockerfile is out of the docker context. But docker has not that limitation.
### Information
- Skaffold version: v1.38.0
- Operating system: Centos 8
- Installed via: curl https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
- Contents of skaffold.yaml:
```yaml
apiVersion: skaffold/v2beta11
kind: Config
build:
artifacts:
- image: my-app
context: my-app
docker:
dockerfile: ../platform/microservice/python3.9-poetry-microservice.dockerfile
```
### Steps to reproduce the behavior
1. create skaffold.yaml as provided, create the my-app folder
2. `skaffold build`
logs:
```
- my-app: Not found. Building
INFO[0001] Cache check completed in 1.916 second subtask=-1 task=Build
Starting build...
Building [my-app]...
DEBU[0001] Running docker build: context: my-app, dockerfile: ../platform/microservice/python3.9-poetry-microservice.dockerfile subtask=my-app task=Build
DEBU[0001] Skipping credential configuration because docker-credential-gcloud is not on PATH. subtask=-1 task=DevLoop
Sending build context to Docker daemon 66.72MB
DEBU[0002] Running command: [tput colors] subtask=-1 task=DevLoop
DEBU[0002] Command output: [256
] subtask=-1 task=DevLoop
Error response from daemon: forbidden path outside the build context: ../platform/microservice/python3.9-poetry-microservice.dockerfile (). Docker build ran into internal error. Please retry.
If this keeps happening, please open an issue..
```
Contributor guide
Assessment
This issue has not been assessed yet.