GoogleContainerTools / GoogleContainerTools/skaffold

Docker builder should support separate dockerfiles for `dev` and `debug`

Open
#5,844 2 comments 0 reactions 0 assignees View on GitHub
area/config build/docker kind/design discussion kind/feature-request priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

Users expect that `skaffold dev` and `skaffold debug` with file-sync will ✨magically✨ rebuild or relaunch their applications built using the Docker builder.

Although we do expose the `SKAFFOLD_RUN_MODE` as a build argument for docker builds, it is difficult to craft a Dockerfile rules to take advantage of it.

I can see two approaches:
1. Use the specified dockerfile and see if there is a `${dockerfile}.${runMode}` (e.g.,`Dockerfile.dev` or `Dockerfile.debug`). But it's impossible for the user to override.
2. Allow the dockerfile to be templated so that they can incorporate the `SKAFFOLD_RUN_MODE` environment variable.
3. Extend the `docker:` definition to allow specifying separate `devDockerfile` and `debugDockerfile` items.

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.