GoogleContainerTools / GoogleContainerTools/skaffold
Disable image push after build for a specific image
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
I have a scenario where it would be very useful to disable image pushing for a specific image.
Given the following skaffold.yaml (excerpt):
```yaml
apiVersion: skaffold/v3
kind: Config
build:
artifacts:
- image: base-build
context: .
docker:
dockerfile: base/Dockerfile.build
- image: base-release
context: .
docker:
dockerfile: base/Dockerfile.release
- image: my-app
context: .
docker:
dockerfile: my-app/Dockerfile
requires:
- image: base-build
alias: BASE_BUILD
- image: base-release
alias: BASE_RELEASE
... more app builds which all use the base-build and base-release images.
```
And `my-app/Dockerfile`:
```Dockerfile
ARG BASE_BUILD
ARG BASE_RELEASE
FROM $BASE_BUILD as build
.. steps to build the app
FROM $BASE_RELEASE as release
COPY --from=build /build/dist/bin/my-app /usr/local/bin/my-app
```
The `base-build` image is always uploaded, but it doesn't have to be. It's never used as a release stage of a multi-stage app Dockerfile so the layers cannot be re-used. The build image is quite large (gigabytes) because it has a huge amount of compilers and lib*-dev's installed. Uploading it takes a long time for developers using the setup.
It would be great if there could be some kind of `build.artifacts[0].push: Never` to override the `build.local.push` value for a specific artifact/image.
I'd be happy to work on this once we have a good design/specs for it.
Contributor guide
Assessment
This issue has not been assessed yet.