Make a repository public
Let anyone pull a repository's images without credentials, or make it private again.
A public repository serves anonymous pulls of its own images. Anonymous access is read-only and reaches only the layers that repository's own images reference, so nothing else in your organization becomes readable, not even a layer the image shares with a private repository. Replace repository-id with the repository's id.
Important
Anyone on the internet can pull a public repository's images. You can switch it back at any time.
Prerequisites
- Permission for
ecr:UpdateRepositoryon the repository. - In the console, also
ecr:DescribeRepositorieson it; without it the repository's page answers 404.
Change the visibility
- Open Image repositories, then open the repository.
- Open the Settings tab.
- Under Visibility, choose Make public.
- Type the repository's name, then choose Make public.
To go back, choose Make private under Visibility; it takes effect without a confirmation.
dcloud ecr repositories update repository-id --visibility publicPATCH /ecr/api/repositories/repository-id
{ "visibility": "public" }resource "dcloud_ecr_repository" "my_app" {
name = "my-app"
visibility = "public"
}Result
Anyone can now run docker pull <host>/my-app:v1.2.0 with no docker login. The repository's page
shows "This repository is public." above its tabs. Pushing still needs ecr:PushImage.
Credentials still decide for whoever presents them: a logged-in user whose policies do not allow
ecr:PullImage on the repository is refused even on a public repository; to pull anonymously, log
out first. After you make a repository private
again, a registry token already handed to an anonymous client works until it expires, at most one
hour.