Skip to content

Commit f5524e1

Browse files
committed
Added docker image.
1 parent 9283fc1 commit f5524e1

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,37 @@ jobs:
101101
mkdir -p $HOME/.cache/snapcraft/stage-packages
102102
if: github.ref_type == 'tag'
103103

104+
- name: Set up QEMU
105+
uses: docker/setup-qemu-action@v3
106+
with:
107+
platforms: arm64
108+
if: github.ref_type == 'tag'
109+
110+
- name: Set up Docker Buildx
111+
uses: docker/setup-buildx-action@v3
112+
with:
113+
#version: v0.12.1
114+
#version: https://github.com/docker/buildx.git#master
115+
driver-opts: network=host
116+
if: github.ref_type == 'tag'
117+
118+
- name: Get Id Token
119+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
120+
id: idtoken1
121+
with:
122+
script: |
123+
let id_token = await core.getIDToken()
124+
core.setOutput('id_token', id_token)
125+
if: github.ref_type == 'tag'
126+
127+
- name: Login to NGINX Registry
128+
uses: docker/login-action@v3
129+
with:
130+
registry: docker-mgmt-test.nginx.com
131+
username: ${{ steps.idtoken1.outputs.id_token }}
132+
password: ${{ github.actor }}
133+
if: github.ref_type == 'tag'
134+
104135
- name: Run GoReleaser
105136
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
106137
with:

.goreleaser.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,36 @@ builds:
2121
main: ./cmd/sync
2222
binary: nginx-asg-sync
2323

24+
dockers_v2:
25+
-
26+
id: distroless-debian
27+
dockerfile: "build/Dockerfile"
28+
ids:
29+
- nginx-asg-sync
30+
images:
31+
- "docker-mgmt-test.nginx.com/nginx/asg-sync"
32+
tags:
33+
- "v{{ .Version }}"
34+
- "latest"
35+
extra_files:
36+
- build/config.yaml.example
37+
- LICENSE
38+
- README.md
39+
labels:
40+
"org.opencontainers.image.description": |-
41+
NGINX Plus Integration with Cloud Autoscaling.
42+
This package contains software that integrates NGINX Plus
43+
with AWS Auto Scaling groups and Azure Virtual Machine Scale Set
44+
"org.opencontainers.image.created": "{{.Date}}"
45+
"org.opencontainers.image.name": "{{.ProjectName}}"
46+
"org.opencontainers.image.revision": "{{.FullCommit}}"
47+
"org.opencontainers.image.version": "{{.Version}}"
48+
"org.opencontainers.image.source": "{{.GitURL}}"
49+
"org.opencontainers.image.license": "BSD-2-Clause"
50+
platforms:
51+
- linux/amd64
52+
- linux/arm64
53+
2454
nfpms:
2555
- file_name_template: "{{ .ConventionalFileName }}"
2656
vendor: NGINX Inc.

build/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM gcr.io/distroless/static-debian13
2+
ARG TARGETPLATFORM
3+
4+
COPY build/config.yaml.example /config.yaml.example
5+
COPY LICENSE /LICENSE
6+
COPY README.md /README.md
7+
COPY $TARGETPLATFORM/nginx-asg-sync /nginx-asg-sync
8+
9+
CMD ["/nginx-asg-sync"]

0 commit comments

Comments
 (0)