Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document multi-stage dockerfile limitations of filesync #6526

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions docs/content/en/docs/pipeline-stages/filesync.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Multiple types of sync are supported by Skaffold:
+ `manual`: The user must specify both the files in their local workspace and the destination in the running container.
This is supported by every type of artifact.

+ `infer`: The destinations for each changed file is inferred from instructions in a Dockerfile.
This is supported by docker and kaniko artifacts and also for custom artifacts that declare a
dependency on a Dockerfile.
+ `infer`: The destinations for each changed file is inferred from the builder.
The docker and kaniko builders examine instructions in a Dockerfile.
This inference is also supported for custom artifacts that declare a dependency on a Dockerfile.

+ `auto`: Skaffold automatically configures the sync. This mode is only supported by Jib and Buildpacks artifacts.
Auto sync mode is enabled by default for Buildpacks artifacts.
Expand Down Expand Up @@ -46,7 +46,8 @@ The following example showcases manual filesync:

### Inferred sync mode

For docker artifacts, Skaffold knows how to infer the desired destination from the artifact's `Dockerfile`.
For docker artifacts, Skaffold knows how to infer the desired destination from the artifact's `Dockerfile`
by examining the `ADD` and `COPY` instructions.
To enable syncing, you only need to specify which files are eligible for syncing in the sync rules.
The sync rules for inferred sync mode is just a list of glob patterns.
The following example showcases this filesync mode:
Expand Down Expand Up @@ -76,6 +77,9 @@ And a `skaffold.yaml` with the following sync configuration:
Inferred sync mode only applies to modified and added files.
File deletion will always cause a complete rebuild.

For multi-stage Dockerfiles, Skaffold only examines the last stage.
Use manual sync rules to sync file copies from other stages.

### Auto sync mode

In auto sync mode, Skaffold automatically generates sync rules for known file types.
Expand Down