GoogleContainerTools / GoogleContainerTools/skaffold

Sync does not work in containers without the tar command

Open
#1,814 6 comments 2 reactions 0 assignees View on GitHub
!! blocked !! area/sync kind/feature-request priority/p3
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.