Skip to content

proposal: unified multi-stage Dockerfile#85

Draft
tamalsaha wants to merge 1 commit into
masterfrom
proposal/unified-dockerfile
Draft

proposal: unified multi-stage Dockerfile#85
tamalsaha wants to merge 1 commit into
masterfrom
proposal/unified-dockerfile

Conversation

@tamalsaha

Copy link
Copy Markdown
Contributor

Summary

Three near-identical template Dockerfiles (`Dockerfile.in` / `.dbg` / `.ubi`) plus a sed-substitution dance in the Makefile is more than the single binary they each wrap should need. The runtime requirements differ because the base images differ; the rest is duplication.

This PR adds a unified `Dockerfile` alongside the existing three — it does not replace them and does not change the Makefile. The new file uses standard docker build-stage targets:

```
docker build --target prod \
--build-arg BIN=external-dns-operator \
--build-arg BASE_PROD= ...
```

Opening as draft / RFC to get sign-off on the layout. If reviewers are happy, a follow-up PR will:

  1. switch the Makefile `container` target to use this file with `--target`
  2. delete `Dockerfile.in` / `.dbg` / `.ubi`
  3. drop the `{ARG_FROM}` sed pipeline

Posting separately because the Makefile cutover touches the release pipeline and shouldn't ride along on a code-review sweep.

Test plan

  • Reviewer sign-off on the layout
  • `docker build --target prod --build-arg BIN=external-dns-operator --build-arg BASE_PROD= -f Dockerfile .` succeeds for a release-equivalent base image
  • Same for `dbg` and `ubi` targets

Three nearly-identical template Dockerfiles (Dockerfile.in / .dbg /
.ubi) plus a sed-substitution dance in the Makefile is more than the
single binary they each wrap should need. The runtime requirements
differ because the base images differ; the rest is duplication.

This change adds a unified Dockerfile alongside the existing three
(neither replaces them nor changes the Makefile). It uses standard
docker build-stage targets:

    docker build --target prod \
        --build-arg BIN=external-dns-operator \
        --build-arg BASE_PROD=<distroless-image> ...

If reviewers are happy with this layout, a follow-up PR will:
  1. switch the Makefile container target to use this file with --target
  2. delete Dockerfile.in / .dbg / .ubi
  3. drop the {ARG_FROM} sed pipeline

Posting separately because the Makefile cutover touches the release
pipeline and shouldn't ride along on a "code review" sweep.

Signed-off-by: Tamal Saha <tamal@appscode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant