Skip to content

Commit 2899b20

Browse files
authored
Add support for Amazon ECR (#123)
1 parent 1c54dba commit 2899b20

File tree

5 files changed

+222
-1
lines changed

5 files changed

+222
-1
lines changed

.github/workflows/alpine-mainline.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ jobs:
3939
- name: Set up Docker Buildx
4040
uses: docker/setup-buildx-action@v2
4141

42+
- name: Configure AWS credentials
43+
uses: aws-actions/configure-aws-credentials@v1
44+
with:
45+
aws-region: ${{ secrets.AWS_REGION }}
46+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
47+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
48+
49+
- name: Login to Amazon ECR
50+
uses: aws-actions/amazon-ecr-login@v1
51+
with:
52+
registry-type: public
53+
4254
- name: Login to Docker Hub
4355
uses: docker/login-action@v2
4456
with:
@@ -52,6 +64,16 @@ jobs:
5264
username: ${{ github.actor }}
5365
password: ${{ secrets.GITHUB_TOKEN }}
5466

67+
- name: Build and push NGINX mainline Alpine image to Amazon ECR
68+
uses: docker/build-push-action@v3
69+
with:
70+
platforms: linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64, linux/386, linux/ppc64le, linux/s390x
71+
context: "{{ defaultContext }}:mainline/alpine"
72+
tags: public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine, public.ecr.aws/nginx/nginx-unprivileged:mainline-alpine, public.ecr.aws/nginx/nginx-unprivileged:1-alpine, public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine, public.ecr.aws/nginx/nginx-unprivileged:alpine
73+
push: true
74+
cache-from: type=gha,scope=alpine
75+
cache-to: type=gha,mode=max,scope=alpine
76+
5577
- name: Build and push NGINX mainline Alpine image to Docker Hub
5678
id: build
5779
uses: docker/build-push-action@v3
@@ -112,6 +134,18 @@ jobs:
112134
- name: Set up Docker Buildx
113135
uses: docker/setup-buildx-action@v2
114136

137+
- name: Configure AWS credentials
138+
uses: aws-actions/configure-aws-credentials@v1
139+
with:
140+
aws-region: ${{ secrets.AWS_REGION }}
141+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
142+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
143+
144+
- name: Login to Amazon ECR
145+
uses: aws-actions/amazon-ecr-login@v1
146+
with:
147+
registry-type: public
148+
115149
- name: Login to Docker Hub
116150
uses: docker/login-action@v2
117151
with:
@@ -125,6 +159,16 @@ jobs:
125159
username: ${{ github.actor }}
126160
password: ${{ secrets.GITHUB_TOKEN }}
127161

162+
- name: Build and push NGINX mainline perl Alpine image to Amazon ECR
163+
uses: docker/build-push-action@v3
164+
with:
165+
platforms: linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64, linux/386, linux/ppc64le, linux/s390x
166+
context: "{{ defaultContext }}:mainline/alpine-perl"
167+
tags: public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine-perl, public.ecr.aws/nginx/nginx-unprivileged:mainline-alpine-perl, public.ecr.aws/nginx/nginx-unprivileged:1-alpine-perl, public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine-perl, public.ecr.aws/nginx/nginx-unprivileged:alpine-perl
168+
push: true
169+
cache-from: type=gha,scope=alpine-perl
170+
cache-to: type=gha,mode=max,scope=alpine-perl
171+
128172
- name: Build and push NGINX mainline perl Alpine image to Docker Hub
129173
id: build
130174
uses: docker/build-push-action@v3
@@ -185,6 +229,18 @@ jobs:
185229
- name: Set up Docker Buildx
186230
uses: docker/setup-buildx-action@v2
187231

232+
- name: Configure AWS credentials
233+
uses: aws-actions/configure-aws-credentials@v1
234+
with:
235+
aws-region: ${{ secrets.AWS_REGION }}
236+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
237+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
238+
239+
- name: Login to Amazon ECR
240+
uses: aws-actions/amazon-ecr-login@v1
241+
with:
242+
registry-type: public
243+
188244
- name: Login to Docker Hub
189245
uses: docker/login-action@v2
190246
with:
@@ -198,6 +254,16 @@ jobs:
198254
username: ${{ github.actor }}
199255
password: ${{ secrets.GITHUB_TOKEN }}
200256

257+
- name: Build and push NGINX mainline slim Alpine image to Amazon ECR
258+
uses: docker/build-push-action@v3
259+
with:
260+
platforms: linux/amd64, linux/arm64
261+
context: "{{ defaultContext }}:mainline/alpine-slim"
262+
tags: public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine-slim, public.ecr.aws/nginx/nginx-unprivileged:mainline-alpine-slim, public.ecr.aws/nginx/nginx-unprivileged:1-alpine-slim, public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine-slim, public.ecr.aws/nginx/nginx-unprivileged:alpine-slim
263+
push: true
264+
cache-from: type=gha,scope=alpine-slim
265+
cache-to: type=gha,mode=max,scope=alpine-slim
266+
201267
- name: Build and push NGINX mainline slim Alpine image to Docker Hub
202268
id: build
203269
uses: docker/build-push-action@v3

.github/workflows/alpine-stable.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ jobs:
3939
- name: Set up Docker Buildx
4040
uses: docker/setup-buildx-action@v2
4141

42+
- name: Configure AWS credentials
43+
uses: aws-actions/configure-aws-credentials@v1
44+
with:
45+
aws-region: ${{ secrets.AWS_REGION }}
46+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
47+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
48+
49+
- name: Login to Amazon ECR
50+
uses: aws-actions/amazon-ecr-login@v1
51+
with:
52+
registry-type: public
53+
4254
- name: Login to Docker Hub
4355
uses: docker/login-action@v2
4456
with:
@@ -52,6 +64,16 @@ jobs:
5264
username: ${{ github.actor }}
5365
password: ${{ secrets.GITHUB_TOKEN }}
5466

67+
- name: Build and push NGINX stable Alpine image to Amazon ECR
68+
uses: docker/build-push-action@v3
69+
with:
70+
platforms: linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64, linux/386, linux/ppc64le, linux/s390x
71+
context: "{{ defaultContext }}:stable/alpine"
72+
tags: public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine, public.ecr.aws/nginx/nginx-unprivileged:stable-alpine, public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine
73+
push: true
74+
cache-from: type=gha,scope=stable-alpine
75+
cache-to: type=gha,mode=max,scope=stable-alpine
76+
5577
- name: Build and push NGINX stable Alpine image to Docker Hub
5678
id: build
5779
uses: docker/build-push-action@v3
@@ -110,6 +132,18 @@ jobs:
110132
- name: Set up Docker Buildx
111133
uses: docker/setup-buildx-action@v2
112134

135+
- name: Configure AWS credentials
136+
uses: aws-actions/configure-aws-credentials@v1
137+
with:
138+
aws-region: ${{ secrets.AWS_REGION }}
139+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
140+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
141+
142+
- name: Login to Amazon ECR
143+
uses: aws-actions/amazon-ecr-login@v1
144+
with:
145+
registry-type: public
146+
113147
- name: Login to Docker Hub
114148
uses: docker/login-action@v2
115149
with:
@@ -123,6 +157,16 @@ jobs:
123157
username: ${{ github.actor }}
124158
password: ${{ secrets.GITHUB_TOKEN }}
125159

160+
- name: Build and push NGINX stable perl Alpine image to Amazon ECR
161+
uses: docker/build-push-action@v3
162+
with:
163+
platforms: linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64, linux/386, linux/ppc64le, linux/s390x
164+
context: "{{ defaultContext }}:stable/alpine-perl"
165+
tags: public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine-perl, public.ecr.aws/nginx/nginx-unprivileged:stable-alpine-perl, public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine-perl
166+
push: true
167+
cache-from: type=gha,scope=stable-alpine-perl
168+
cache-to: type=gha,mode=max,scope=stable-alpine-perl
169+
126170
- name: Build and push NGINX stable perl Alpine image to Docker Hub
127171
id: build
128172
uses: docker/build-push-action@v3
@@ -181,6 +225,18 @@ jobs:
181225
- name: Set up Docker Buildx
182226
uses: docker/setup-buildx-action@v2
183227

228+
- name: Configure AWS credentials
229+
uses: aws-actions/configure-aws-credentials@v1
230+
with:
231+
aws-region: ${{ secrets.AWS_REGION }}
232+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
233+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
234+
235+
- name: Login to Amazon ECR
236+
uses: aws-actions/amazon-ecr-login@v1
237+
with:
238+
registry-type: public
239+
184240
- name: Login to Docker Hub
185241
uses: docker/login-action@v2
186242
with:
@@ -194,6 +250,16 @@ jobs:
194250
username: ${{ github.actor }}
195251
password: ${{ secrets.GITHUB_TOKEN }}
196252

253+
- name: Build and push NGINX stable slim Alpine image to Amazon ECR
254+
uses: docker/build-push-action@v3
255+
with:
256+
platforms: linux/amd64, linux/arm64
257+
context: "{{ defaultContext }}:stable/alpine-slim"
258+
tags: public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-alpine-slim, public.ecr.aws/nginx/nginx-unprivileged:stable-alpine-slim, public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-alpine-slim
259+
push: true
260+
cache-from: type=gha,scope=stable-alpine-slim
261+
cache-to: type=gha,mode=max,scope=stable-alpine-slim
262+
197263
- name: Build and push NGINX stable slim Alpine image to Docker Hub
198264
id: build
199265
uses: docker/build-push-action@v3

.github/workflows/debian-mainline.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ jobs:
3939
- name: Set up Docker Buildx
4040
uses: docker/setup-buildx-action@v2
4141

42+
- name: Configure AWS credentials
43+
uses: aws-actions/configure-aws-credentials@v1
44+
with:
45+
aws-region: ${{ secrets.AWS_REGION }}
46+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
47+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
48+
49+
- name: Login to Amazon ECR
50+
uses: aws-actions/amazon-ecr-login@v1
51+
with:
52+
registry-type: public
53+
4254
- name: Login to Docker Hub
4355
uses: docker/login-action@v2
4456
with:
@@ -52,6 +64,16 @@ jobs:
5264
username: ${{ github.actor }}
5365
password: ${{ secrets.GITHUB_TOKEN }}
5466

67+
- name: Build and push NGINX mainline Debian image to Amazon ECR
68+
uses: docker/build-push-action@v3
69+
with:
70+
platforms: linux/amd64, linux/arm/v5, linux/arm/v7, linux/arm64, linux/386, linux/mips64le, linux/ppc64le, linux/s390x
71+
context: "{{ defaultContext }}:mainline/debian"
72+
tags: public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}, public.ecr.aws/nginx/nginx-unprivileged:mainline, public.ecr.aws/nginx/nginx-unprivileged:1, public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}, public.ecr.aws/nginx/nginx-unprivileged:latest
73+
push: true
74+
cache-from: type=gha,scope=debian
75+
cache-to: type=gha,mode=max,scope=debian
76+
5577
- name: Build and push NGINX mainline Debian image to Docker Hub
5678
id: build
5779
uses: docker/build-push-action@v3
@@ -112,6 +134,18 @@ jobs:
112134
- name: Set up Docker Buildx
113135
uses: docker/setup-buildx-action@v2
114136

137+
- name: Configure AWS credentials
138+
uses: aws-actions/configure-aws-credentials@v1
139+
with:
140+
aws-region: ${{ secrets.AWS_REGION }}
141+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
142+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
143+
144+
- name: Login to Amazon ECR
145+
uses: aws-actions/amazon-ecr-login@v1
146+
with:
147+
registry-type: public
148+
115149
- name: Login to Docker Hub
116150
uses: docker/login-action@v2
117151
with:
@@ -125,6 +159,16 @@ jobs:
125159
username: ${{ github.actor }}
126160
password: ${{ secrets.GITHUB_TOKEN }}
127161

162+
- name: Build and push NGINX mainline perl Debian image to Amazon ECR
163+
uses: docker/build-push-action@v3
164+
with:
165+
platforms: linux/amd64, linux/arm/v5, linux/arm/v7, linux/arm64, linux/386, linux/mips64le, linux/ppc64le, linux/s390x
166+
context: "{{ defaultContext }}:mainline/debian-perl"
167+
tags: public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-perl, public.ecr.aws/nginx/nginx-unprivileged:mainline-perl, public.ecr.aws/nginx/nginx-unprivileged:1-perl, public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-perl, public.ecr.aws/nginx/nginx-unprivileged:perl
168+
push: true
169+
cache-from: type=gha,scope=debian-perl
170+
cache-to: type=gha,mode=max,scope=debian-perl
171+
128172
- name: Build and push NGINX mainline perl Debian image to Docker Hub
129173
id: build
130174
uses: docker/build-push-action@v3

.github/workflows/debian-stable.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ jobs:
3939
- name: Set up Docker Buildx
4040
uses: docker/setup-buildx-action@v2
4141

42+
- name: Configure AWS credentials
43+
uses: aws-actions/configure-aws-credentials@v1
44+
with:
45+
aws-region: ${{ secrets.AWS_REGION }}
46+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
47+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
48+
49+
- name: Login to Amazon ECR
50+
uses: aws-actions/amazon-ecr-login@v1
51+
with:
52+
registry-type: public
53+
4254
- name: Login to Docker Hub
4355
uses: docker/login-action@v2
4456
with:
@@ -52,6 +64,16 @@ jobs:
5264
username: ${{ github.actor }}
5365
password: ${{ secrets.GITHUB_TOKEN }}
5466

67+
- name: Build and push NGINX stable Debian image to Amazon ECR
68+
uses: docker/build-push-action@v3
69+
with:
70+
platforms: linux/amd64, linux/arm/v5, linux/arm/v7, linux/arm64, linux/mips64le, linux/ppc64le, linux/s390x
71+
context: "{{ defaultContext }}:stable/debian"
72+
tags: public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}, public.ecr.aws/nginx/nginx-unprivileged:stable, public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}
73+
push: true
74+
cache-from: type=gha,scope=stable-debian
75+
cache-to: type=gha,mode=max,scope=stable-debian
76+
5577
- name: Build and push NGINX stable Debian image to Docker Hub
5678
id: build
5779
uses: docker/build-push-action@v3
@@ -110,6 +132,18 @@ jobs:
110132
- name: Set up Docker Buildx
111133
uses: docker/setup-buildx-action@v2
112134

135+
- name: Configure AWS credentials
136+
uses: aws-actions/configure-aws-credentials@v1
137+
with:
138+
aws-region: ${{ secrets.AWS_REGION }}
139+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
140+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
141+
142+
- name: Login to Amazon ECR
143+
uses: aws-actions/amazon-ecr-login@v1
144+
with:
145+
registry-type: public
146+
113147
- name: Login to Docker Hub
114148
uses: docker/login-action@v2
115149
with:
@@ -123,6 +157,16 @@ jobs:
123157
username: ${{ github.actor }}
124158
password: ${{ secrets.GITHUB_TOKEN }}
125159

160+
- name: Build and push NGINX stable perl Debian image to Amazon ECR
161+
uses: docker/build-push-action@v3
162+
with:
163+
platforms: linux/amd64, linux/arm/v5, linux/arm/v7, linux/arm64, linux/386, linux/mips64le, linux/ppc64le, linux/s390x
164+
context: "{{ defaultContext }}:mainline/debian-perl"
165+
tags: public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}.${{ needs.version.outputs.patch }}-perl, public.ecr.aws/nginx/nginx-unprivileged:stable-perl, public.ecr.aws/nginx/nginx-unprivileged:${{ needs.version.outputs.major }}.${{ needs.version.outputs.minor }}-perl
166+
push: true
167+
cache-from: type=gha,scope=stable-debian-perl
168+
cache-to: type=gha,mode=max,scope=stable-debian-perl
169+
126170
- name: Build and push NGINX stable perl Debian image to Docker Hub
127171
id: build
128172
uses: docker/build-push-action@v3

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ Check out the [docs](https://hub.docker.com/_/nginx) for the upstream Docker NGI
1919

2020
You can find built images in the following registries:
2121

22-
* GitHub Container Registry - <https://github.com/nginxinc/docker-nginx-unprivileged/pkgs/container/nginx-unprivileged>
22+
* Amazon ECR - <https://gallery.ecr.aws/nginx/nginx-unprivileged>
2323
* Docker Hub - <https://hub.docker.com/r/nginxinc/nginx-unprivileged>
24+
* GitHub Container Registry - <https://github.com/nginxinc/docker-nginx-unprivileged/pkgs/container/nginx-unprivileged>
2425

2526
### Platforms
2627

0 commit comments

Comments
 (0)