-
Notifications
You must be signed in to change notification settings - Fork 181
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
regression: v1.1.0 doesn't work with GCP artifact registry using custom docker image , v1.0.0 correctly works #1204
Comments
From the given logs, I can see that
@gpongelli Are you running both commands in the same container? What base image are you using to run commands? How is the token provided(have you run |
Hi @qweeah ,
those images run with root user, and the run command are into {
"auths":
{"https://europe-docker.pkg.dev":
{"username": "_json_key",
"password": "{\n \"type\": \"service_account\",\n \"project_id\": \"<GCP-PROJECT>\",\n \"private_key_id\": \"<KEY-ID>\",\n \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n<PRIVATE-KEY>\\n-----END PRIVATE KEY-----\\n\",\n \"client_email\": \"<SERVICE-ACCOUNT-EMAIL>.iam.gserviceaccount.com\",\n \"client_id\": \"<CLIENT-ID>\",\n \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\": \"https://oauth2.googleapis.com/token\",\n \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/<SERVICE-ACCOUNT-EMAIL>.iam.gserviceaccount.com\"\n}", "email": "<SERVICE-ACCOUNT-EMAIL>.iam.gserviceaccount.com", "auth": "<AUTHENTICATION-VERY-LONG-FIELD>"
}
}
} So, I'm using:
|
@gpongelli Thanks for the input. The only ambiguity I can see in the auth file, is that both Can you help try v1.0.1? It uses same cred SDK(oras-credentials-go v0.2.0) as ORAS v1.1.0. You can verify it easily via using oras CLI container, e.g. docker run -v ~/.docker/config.json:/root/.docker/config.json ghcr.io/oras-project/oras:v1.0.1 pull -d <GCP-artifact-registry-path-toartifact>:<version> If it fails, can you help remove the |
So which is the content that oras needs?
Removing the I’ll let you know. |
No, I mean try with below config.json file: {
"auths":
{"https://europe-docker.pkg.dev":
{"username": "_json_key",
"password": "{\n \"type\": \"service_account\",\n \"project_id\": \"<GCP-PROJECT>\",\n \"private_key_id\": \"<KEY-ID>\",\n \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n<PRIVATE-KEY>\\n-----END PRIVATE KEY-----\\n\",\n \"client_email\": \"<SERVICE-ACCOUNT-EMAIL>.iam.gserviceaccount.com\",\n \"client_id\": \"<CLIENT-ID>\",\n \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\": \"https://oauth2.googleapis.com/token\",\n \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/<SERVICE-ACCOUNT-EMAIL>.iam.gserviceaccount.com\"\n}", "email": "<SERVICE-ACCOUNT-EMAIL>.iam.gserviceaccount.com"
}
}
} The |
Hi @qweeah ,
|
@Wwwsylvia @wangxiaoxuan273 Any idea on why oras-credentials-go v0.2.0 might fail to pick up the credential in config.json? |
@gpongelli There is an unexpected prefix of the If you want to use oras v1.1.0, you need replace |
@gpongelli To check if #1143 fixed your issue or not, you may try with our ghcr build of main branch: docker run -v ~/.docker/config.json:/root/.docker/config.json ghcr.io/oras-project/oras:main pull -d <GCP-artifact-registry-path-toartifact>:<version> |
Hi @qweeah , Thank you very much! |
What happened in your environment?
the error happens with ORAS 1.1.0 :
obviously some sensitive information are masked
What did you expect to happen?
previous ORAS 1.0.0 works as expected:
obviously some sensitive information are masked
How can we reproduce it?
I've created two custom docker images with ORAS manually installed, one with ORAS v1.0.0 and another with ORAS v1.1.0, to be run through jenkins on a k8s environment, this is the dockerfile used to create the images:
then use a .docker/config.json file with the content of a k8s service account used to push/pull artifact into GCP artifact registry.
The two docker images are executed, mounting .docker folder to the container's user .docker folder to do authentication, with:
docker run -it -v C:\Users\gpongelli\.docker\:/root/.docker <custom-docker-image>:1.1.0
docker run -it -v C:\Users\gpongelli\.docker\:/root/.docker <custom-docker-image>:1.0.0
into those images I've executed the
oras pull
command reported above.Thanks!
What is the version of your ORAS CLI?
Version: 1.1.0
Go version: go1.21.0
Git commit: 7079c46
Git tree state: clean
What is your OS environment?
docker image
Are you willing to submit PRs to fix it?
The text was updated successfully, but these errors were encountered: