mirror of
https://github.com/docker/login-action.git
synced 2025-04-19 01:26:45 +00:00
Add example for Azure Container Registry (ACR)
This commit is contained in:
parent
1bd3567034
commit
e56233ce43
5 changed files with 52 additions and 20 deletions
37
README.md
37
README.md
|
@ -3,6 +3,7 @@
|
|||
[](https://github.com/crazy-max/ghaction-docker-login/actions?workflow=ci)
|
||||
[](https://github.com/crazy-max/ghaction-docker-login/actions?workflow=test)
|
||||
[](https://codecov.io/gh/crazy-max/ghaction-docker-login)
|
||||
|
||||
[](https://github.com/sponsors/crazy-max)
|
||||
[](https://www.paypal.me/crazyws)
|
||||
|
||||
|
@ -20,8 +21,9 @@ ___
|
|||
* [DockerHub](#dockerhub)
|
||||
* [GitHub Package Registry](#github-package-registry)
|
||||
* [GitLab](#gitlab)
|
||||
* [Google Container Registry (GCR)](#gitlab)
|
||||
* [AWS Elastic Container Registry (ECR)](#gitlab)
|
||||
* [Azure Container Registry (ACR)](#azure-container-registry-acr)
|
||||
* [Google Container Registry (GCR)](#google-container-registry-gcr)
|
||||
* [AWS Elastic Container Registry (ECR)](#aws-elastic-container-registry-ecr)
|
||||
* [Customizing](#customizing)
|
||||
* [inputs](#inputs)
|
||||
* [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot)
|
||||
|
@ -105,6 +107,37 @@ jobs:
|
|||
password: ${{ secrets.GITLAB_PASSWORD }}
|
||||
```
|
||||
|
||||
### Azure Container Registry (ACR)
|
||||
|
||||
[Create a service principal](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-service-principal#create-a-service-principal)
|
||||
with access to your container registry through the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
||||
and take note of the generated service principal's ID (also called _client ID_) and password (also called _client secret_).
|
||||
|
||||
```yaml
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: master
|
||||
|
||||
jobs:
|
||||
login:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Login to ACR
|
||||
uses: crazy-max/ghaction-docker-login@v1
|
||||
with:
|
||||
registry: <registry-name>.azurecr.io
|
||||
username: ${{ secrets.AZURE_CLIENT_ID }}
|
||||
password: ${{ secrets.AZURE_CLIENT_SECRET }}
|
||||
```
|
||||
|
||||
> Replace `<registry-name>` with the name of your registry.
|
||||
|
||||
### Google Container Registry (GCR)
|
||||
|
||||
Use a service account with the ability to push to GCR and [configure access control](https://cloud.google.com/container-registry/docs/access-control).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue