Merge pull request #129 from carlossg/credentials-pass

Use kaniko with docker config.json password
This commit is contained in:
Tejal Desai 2019-10-04 08:44:28 -07:00 committed by GitHub
commit de093f9e05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 1 deletions

View File

@ -282,7 +282,29 @@ See the `examples` directory for how to use with kubernetes clusters and persist
kaniko uses Docker credential helpers to push images to a registry.
kaniko comes with support for GCR and Amazon ECR, but configuring another credential helper should allow pushing to a different registry.
kaniko comes with support for GCR, Docker `config.json` and Amazon ECR, but configuring another credential helper should allow pushing to a different registry.
#### Pushing to Docker Hub
Get your docker registry user and password encoded in base64
echo USER:PASSWORD | base64
Create a `config.json` file with your Docker registry url and the previous generated base64 string
```
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "xxxxxxxxxxxxxxx"
}
}
}
```
Run kaniko with the `config.json` inside `/kaniko/.docker/config.json`
docker run -ti --rm -v `pwd`:/workspace -v config.json:/kaniko/.docker/config.json:ro gcr.io/kaniko-project/executor:latest --dockerfile=Dockerfile --destination=yourimagename
#### Pushing to Amazon ECR