GoogleContainerTools / GoogleContainerTools/skaffold

Dockerfile file analysis should support Buildkit's `RUN --mount`

Open
#6,091 1 comment 3 reactions 0 assignees View on GitHub
area/build build/docker help wanted kind/feature-request priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

_(From the [`#skaffold` Slack channel](https://kubernetes.slack.com/archives/CABQMSZA6/p1624662175123800))_

Buildkit supports [`run --mount=type=bind,source=xxx,target=yyy`](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/syntax.md#run---mounttypebind-the-default-mount-type) which behaves similar to a `COPY xxx yyy`. The `type=bind` can be omitted as this is the default mount type.

The doc does say that this is only valid with [dockerfile syntax 1.2 or above](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/syntax.md#build-mounts-run---mount):
> To use this flag set Dockerfile version to at least 1.2
>
> `# syntax=docker/dockerfile:1.2`

### Expected behavior

Skaffold would detect changes to the source in `xxx` and trigger a rebuild.

### Actual behavior

[Skaffold doesn't detect the source changes.](https://kubernetes.slack.com/archives/CABQMSZA6/p1624662175123800)
Screen Shot 2021-06-28 at 10 39 03 AM

### Information

- Skaffold version: unspecified

### Workaround

Insert manual `COPY` statements.

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.