-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Consider switching to ghcr.io/distroless images #4752
Comments
cc @afrittoli |
+1 to smaller images, but especially +1 to simpler, more declarative images. Just so I can concretely understand the proposal:
pipeline/tekton/build-push-ma-base-image.yaml Lines 90 to 91 in 5ac6ef7
I think it's definitely worth drafting a PR for, to get an idea what else shakes out from this. But I'm definitely happy with what I'm seeing so far. 😍 |
@imjasonh I'd probably split the switchover from deleting the Dockerfile, in case we want a really simple rollback, but that should definitely be the goal! |
I do not see any reason not to switch to it so 👍🏼 |
Cool, I will try to draft the first part today. Then I'll stage something to try to remove the rest, which we can merge once we are comfortable with the switchover (I'll need help making sure I caught everything, but I'll start with @imjasonh fantastic list! 🤩 ) |
Alright, I kicked it and it picked up
|
So grepping the code base, I also found
... but want to sanity check. I'll include this in my PR, but please pay attention and check my work because I kinda doubt this is tested presubmit 😅 |
This swaps out the use of `gcr.io/distroless/base:debug` for the new `ghcr.io/distroless/busybox` image (since the former was being used exclusively for it having busybox). This also swaps our the `Dockerfile` based `git-init` base image in favor of `ghcr.io/distroless/git` since it is now possible to produce a `distroless` Git image without losing one's sanity. This does NOT remove the `Dockerfile` or any logic to build it just yet, in case we want to roll this back, but that should follow in a subsequent change (tracked by the issue below). Related: tektoncd#4752
That sounds about right 🙃 |
This swaps out the use of `gcr.io/distroless/base:debug` for the new `ghcr.io/distroless/busybox` image (since the former was being used exclusively for it having busybox). This also swaps our the `Dockerfile` based `git-init` base image in favor of `ghcr.io/distroless/git` since it is now possible to produce a `distroless` Git image without losing one's sanity. This does NOT remove the `Dockerfile` or any logic to build it just yet, in case we want to roll this back, but that should follow in a subsequent change (tracked by the issue below). Related: tektoncd#4752
This swaps our `Dockerfile` based `git-init` base image in favor of `ghcr.io/distroless/git` since it is now possible to produce a `distroless` Git image without losing one's sanity. This does NOT remove the `Dockerfile` or any logic to build it just yet, in case we want to roll this back, but that should follow in a subsequent change (tracked by the issue below). Related: tektoncd#4752
This is very similar to tektoncd#4758 and tektoncd#4717 but for `shell-image`. This switches the default user of the `shell-image` to `nonroot`, which forces Tekton to be explicit about all of the places it needs a shell as `root` using `runAsUser: 0`. This also switches things over to a much leaner `busybox` image (no `glibc`), which is the main thing we use `base:debug` for with the OG distroless images. Fixes: tektoncd#4761 Related: tektoncd#4752
This is very similar to tektoncd#4758 and tektoncd#4717 but for `shell-image`. This switches the default user of the `shell-image` to `nonroot`, which forces Tekton to be explicit about all of the places it needs a shell as `root` using `runAsUser: 0`. This also switches things over to a much leaner `busybox` image (no `glibc`), which is the main thing we use `base:debug` for with the OG distroless images. Fixes: tektoncd#4761 Related: tektoncd#4752
This is very similar to tektoncd#4758 and tektoncd#4717 but for `shell-image`. This switches the default user of the `shell-image` to `nonroot`, which forces Tekton to be explicit about all of the places it needs a shell as `root` using `runAsUser: 0`. This also switches things over to a much leaner `busybox` image (no `glibc`), which is the main thing we use `base:debug` for with the OG distroless images. Fixes: tektoncd#4761 Related: tektoncd#4752
This is very similar to tektoncd#4758 and tektoncd#4717 but for `shell-image`. This switches the default user of the `shell-image` to `nonroot`, which forces Tekton to be explicit about all of the places it needs a shell as `root` using `runAsUser: 0`. This also switches things over to a much leaner `busybox` image (no `glibc`), which is the main thing we use `base:debug` for with the OG distroless images. Fixes: tektoncd#4761 Related: tektoncd#4752
Landing the first round of these now, please let me know if you see anything weird. Next order of business will be to stage cleaning up the |
This swaps our `Dockerfile` based `git-init` base image in favor of `ghcr.io/distroless/git` since it is now possible to produce a `distroless` Git image without losing one's sanity. This does NOT remove the `Dockerfile` or any logic to build it just yet, in case we want to roll this back, but that should follow in a subsequent change (tracked by the issue below). Related: #4752
This is very similar to #4758 and #4717 but for `shell-image`. This switches the default user of the `shell-image` to `nonroot`, which forces Tekton to be explicit about all of the places it needs a shell as `root` using `runAsUser: 0`. This also switches things over to a much leaner `busybox` image (no `glibc`), which is the main thing we use `base:debug` for with the OG distroless images. Fixes: #4761 Related: #4752
For deleting build-push-ma-base-image.yaml I'm unsure where this is |
My previous change switched us off of the Dockerfile-based `git-init` base image in favor of `ghcr.io/distroless/git` (:tada:), however, I wanted to stagger cleaning this up so we could keep rebuilding it in case we needed to rollback. This cleans up the Dockerfile and Task, which should complete the migration. Fixes: tektoncd#4752
pipeline/tekton/release-pipeline.yaml Lines 107 to 127 in 1ddb31c
Which blocks pipeline/tekton/release-pipeline.yaml Line 129 in 1ddb31c
...which should just have:
|
Looking closer, there's two different pipeline params, So in removing Though it looks like the default values defined in the Pipeline: pipeline/tekton/release-pipeline.yaml Lines 30 to 35 in 8fdcc09
...match the defaults defined in the Task: Lines 28 to 30 in 8fdcc09
So maybe we can just remove the Pipeline param entirely and just rely on the Task param's default? 🤔 |
This swaps our `Dockerfile` based `git-init` base image in favor of `ghcr.io/distroless/git` since it is now possible to produce a `distroless` Git image without losing one's sanity. This does NOT remove the `Dockerfile` or any logic to build it just yet, in case we want to roll this back, but that should follow in a subsequent change (tracked by the issue below). Related: tektoncd#4752
This is very similar to tektoncd#4758 and tektoncd#4717 but for `shell-image`. This switches the default user of the `shell-image` to `nonroot`, which forces Tekton to be explicit about all of the places it needs a shell as `root` using `runAsUser: 0`. This also switches things over to a much leaner `busybox` image (no `glibc`), which is the main thing we use `base:debug` for with the OG distroless images. Fixes: tektoncd#4761 Related: tektoncd#4752
I wanted to circle back to this, since this has now presumably had reasonable bake time. Do folks have any final thoughts on this, or should we remove the hold on #4765? |
Ok, I am going to remove the hold. I believe Prow will rerun everything, and this gives us tomorrow to fix things before the weekend if some crazy merge conflict snuck in. 🤞 |
My previous change switched us off of the Dockerfile-based `git-init` base image in favor of `ghcr.io/distroless/git` (:tada:), however, I wanted to stagger cleaning this up so we could keep rebuilding it in case we needed to rollback. This cleans up the Dockerfile and Task, which should complete the migration. Fixes: #4752
We have been starting to pursue (with
apko
) the next generation of "distroless" tooling, and that has made curating images with complex dependencies (e.g.git
) much more tractable than the old model. I chased the idea of "distroless git" years ago when we were starting knative/build and the dependency tree made this a nightmare, but with the new tooling, it's actually very tight!I put together github.com/distroless/git largely based on the Tekton Dockerfile's
apk add
line: https://github.com/distroless/git/blob/1473a6a03596395baa6e99221405467c94f69798/.apko.yaml#L8-L10Since this is a "distroless" image, it is actually smaller than what y'all have today (though since the bulk of it is from
git
, the difference isn't huge):Another place worth considering a switch is your use of
gcr.io/distroless/base:debug
for your "shell image" here:pipeline/config/controller.yaml
Lines 78 to 81 in 5ac6ef7
This uses
base:debug
vs.static:debug
because the latter doesn't exist, but really all you are after is the fact that:debug
containsbusybox
. We createdgithub.com/distroless/busybox
for this, which (withoutglibc
) is considerably smaller:We have been using
ghcr.io/distroless/git
andghcr.io/distroless/busybox
for each of these in our downstream testing for several days now without issue, and so I wanted to start a discussion around replacing these upstream (and eliminating the need to maintain thegit-init
Dockerfile
+ builds)...cc @vdemeester @imjasonh @dlorenc @bobcatfish
The text was updated successfully, but these errors were encountered: