GoogleContainerTools / GoogleContainerTools/skaffold
Sync does not work in containers without the tar command
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
### Expected behavior
Changed files are synced to the container. The example below does not make much sense, but it does also affect distroless containers.
### Actual behavior
Sync fails with
```
DEBU[0007] Running command: [kubectl exec getting-started --namespace default -c getting-started -i -- tar xmf - -C / --no-same-owner]
WARN[0007] Skipping deploy due to sync error: copying files: exit status 126
```
### Information
- Skaffold version: >0.24 (since #1641)
### Steps to reproduce the behavior
Based on the examples/getting-started example
1. Modify Dockerfile to
```
FROM golang:1.10.1-alpine3.7 as builder
COPY main.go .
RUN go build -o /app main.go
FROM scratch
ENTRYPOINT ["./app"]
COPY . /unused
COPY --from=builder /app .
```
2. Modify skaffold.yaml
```
apiVersion: skaffold/v1beta7
kind: Config
build:
artifacts:
- image: gcr.io/k8s-skaffold/skaffold-example
sync:
- '*.go': /
deploy:
kubectl:
manifests:
- k8s-*
```
3. `skaffold dev -v debug`
4. Change `main.go` and wait for sync.
Contributor guide
Assessment
This issue has not been assessed yet.