Skip to content
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

Support for 3rd party container registries #3241

Closed
Tracked by #2729
wbreza opened this issue Jan 27, 2024 · 3 comments · Fixed by #3450
Closed
Tracked by #2729

Support for 3rd party container registries #3241

wbreza opened this issue Jan 27, 2024 · 3 comments · Fixed by #3450
Assignees
Labels
aca Azure Container Apps aks Azure Kubernetes Service
Milestone

Comments

@wbreza
Copy link
Contributor

wbreza commented Jan 27, 2024

Proposal

Optional registry and repository configuration elements within docker

Each container configuration element will allow a registry and repository configurations within the docker options that will allow support for specifying the registry and repository that should be used for the container image when build.

If registry is not specified it will fall back to the AZURE_CONTAINER_REGISTRY_ENDPOINT environment variable specified within the azd environment.

If repository is not specified it will default a convention of {project.name}-{service.name}

ACR registries will be natively support and leverage the current logged in principal. To support 3rd party private registries users will need to ensure they run the docker login command with their credentials commands prior deploying from azd.

These options can be configured at the root of the conatainerapp or within each container depending on the application requirements.

Example

The following example shows how a custom registry can be specified when using container apps. In this example the container would be built and pushed to a private container registry on Docker Hub.

Note

Users would need to ensure they are pre-authenticated into the Docker CLI to allow pushing to private sources.

# azure.yaml

name: my-project
metadata:
  template: my-project@0.0.1-beta
services:
  api:
    project: ./src/api
    language: js
    host: containerapp
    docker: 
      registry: docker.io/wbreza
      repository: my-project
      tag: latest
@wbreza wbreza added aks Azure Kubernetes Service aca Azure Container Apps labels Jan 27, 2024
@spboyer
Copy link
Member

spboyer commented Jan 31, 2024

there are a few registry providers beyond docker. GitHub, GitLab, Docker, Azure, Google, private registries etc. Need to consider authentication and other variations for providers if we go down this route. Check with containers tooling team on their work for this. @bwateratmsft

@bwateratmsft
Copy link
Contributor

As long as all you need to do is use the Docker CLI to pull / push, auth is just a username + a secret given to the Docker CLI. If you need to browse available images (which is what the Docker extension is doing), auth becomes much more complicated and nearly every registry provider has their own auth story.

@wbreza
Copy link
Contributor Author

wbreza commented Jan 31, 2024

Yes, the initial goal would to continue to use the docker CLI since we already take a dependency on it and users will just need to authenticate outside of azd via docker login ... before calling into azd.

@rajeshkamal5050 rajeshkamal5050 added this to the February 2024 milestone Feb 7, 2024
wbreza added a commit that referenced this issue Mar 2, 2024
Resolves #3241
Allows pushing container images to external container registries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aca Azure Container Apps aks Azure Kubernetes Service
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants