-
Notifications
You must be signed in to change notification settings - Fork 113
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
Build is missing support to specify a secret for FROM images in Dockerfiles #531
Comments
Thanks for raise this issue up. A quick question, can we share the same account or use one secret for both |
We at the moment allow the user to define the But, it effectively means that account sharing and |
Yeah I agree this seems like a good catch. FWIW, there is some openshift build v1 perspective on this
So yeah, in theory,
|
Good feedback @gabemontero. One thing I consider difficult from a user's perspective is having one Kubernetes The easiest way to create such a Downstream, IBM Cloud Code Engine even goes one step further and somehow expects secrets to contain a single credential (because we list them an UI and CLI and also show the registry host and user name there). |
I wonder how much docker related background comes into play here. Those who were deep into using docker before coming to k8s are probably not bothered by this at all. I see that for example with the devops crew who managed say openshift online or our internal CI system, which is comprised of many k8s/openshift clusters. They are definitely using Secrets which contain credentials to multiple registries via import docker config files.
Yep, in that doc link https://docs.openshift.com/container-platform/4.6/builds/creating-build-inputs.html#builds-docker-credentials-private-registries_creating-build-inputs I posted earlier, you'll see that exact same
So if I were to recap: |
In a
Build
, we currently have "3.5" places to define a reference to a KubernetesSecret
:spec.source.credentials.name
for the Git repositoryspec.builder.credentials.name
for the pull operation of the builder image (atm only used by the s2i build strategy)spec.output.credentials.name
for the push operation of the output imagespec.runtime.base.credentials.name
can be specified but is not used anywhere in our codeIn general, although, we have a purpose for each of the
Secret
s, we "only" place them in theServiceAccount
associated with theTaskRun
. Tekton will then take care of them to make them available to all its containers. This means that theoretically, aSecret
specified under the output, can be used by any container registry related operation in any build step.This includes the pulling of
FROM
image(s) in a Dockerfile-based build. I only checked Kaniko, but expect buildah to also use aSecret
to pull theFROM
image(s). Using aSecret
to pull theFROM
is required or useful for these two scenarios:FROM
image comes from a private registry. In this case, authentication is required.FROM
image comes from a public repository at DockerHub. The rate limits there limits anonymous access. To get a guarantee that the image pull works requires to use authentication. Otherwise too manyBuildRun
s by potentially multiple users can cause 429 responses from DockerHub.As of today, we only support authentication for the image pull of the
FROM
image(s) if it comes from the same container registry that is also used for the output or builder image. This blocks those scenarios where this is not the case.We should provide means to specify other
Secret
s somewhere in theBuild
to support authentication forFROM
image(s).Side note: there is a bug/limitation currently in Tekton so that only one
Secret
of type dockerconfigjson is supported. PR Support multiple secrets of type dockercfg and dockerconfigjson #3659 is supposed to lift this.The text was updated successfully, but these errors were encountered: