File tree 4 files changed +79
-0
lines changed
4 files changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ (import './docker-build-simple.libsonnet' )('dnscollector' )
Original file line number Diff line number Diff line change
1
+ {
2
+ " jobs " : {
3
+ " build " : {
4
+ " name " : " build" ,
5
+ " permissions " : {
6
+ " contents " : " read" ,
7
+ " id-token " : " write"
8
+ },
9
+ " runs-on " : " ubuntu-latest" ,
10
+ " steps " : [
11
+ {
12
+ " uses " : " docker/setup-qemu-action@v2"
13
+ },
14
+ {
15
+ " uses " : " docker/setup-buildx-action@v2"
16
+ },
17
+ {
18
+ " uses " : " aws-actions/configure-aws-credentials@v1" ,
19
+ " with " : {
20
+ " aws-region " : " ap-northeast-1" ,
21
+ " role-skip-session-tagging " : true,
22
+ " role-to-assume " : " arn:aws:iam::005216166247:role/GhaDockerPush"
23
+ }
24
+ },
25
+ {
26
+ " id " : " login-ecr" ,
27
+ " uses " : " aws-actions/amazon-ecr-login@v1"
28
+ },
29
+ {
30
+ " uses " : " docker/build-push-action@v3" ,
31
+ " with " : {
32
+ " context " : " {{defaultContext}}:dnscollector" ,
33
+ " platforms " : " linux/arm64" ,
34
+ " push " : true,
35
+ " tags " : " ${{ steps.login-ecr.outputs.registry }}/dnscollector:${{ github.sha }},${{ steps.login-ecr.outputs.registry }}/dnscollector:latest"
36
+ }
37
+ }
38
+ ]
39
+ }
40
+ },
41
+ " name " : " docker-dnscollector" ,
42
+ " on " : {
43
+ " push " : {
44
+ " branches " : [
45
+ " main" ,
46
+ " test"
47
+ ],
48
+ " paths " : [
49
+ " dnscollector/**" ,
50
+ " .github/workflows/docker-dnscollector.yml"
51
+ ]
52
+ }
53
+ }
54
+ }
Original file line number Diff line number Diff line change
1
+ FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/golang:1.22-bookworm as build
2
+
3
+ ENV GOOS=linux
4
+ ENV GOARCH=arm64
5
+ ENV CGO_ENABLED=0
6
+
7
+ RUN go install github.com/dmachard/go-dnscollector@25b9b58c2f508719d6b9f7d5f58f753028fcc1f2
8
+
9
+ # ##
10
+
11
+ FROM public.ecr.aws/ubuntu/ubuntu:24.04
12
+
13
+ COPY --from=build /go/bin/linux_arm64/go-dnscollector /usr/local/bin/dnscollector
14
+ COPY --chmod=0755 entrypoint.sh /
15
+
16
+ ENTRYPOINT ["/entrypoint.sh" ]
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -euo pipefail
3
+
4
+ if [[ ${1:- } = /* ]]; then
5
+ exec " $@ "
6
+ fi
7
+
8
+ exec /usr/local/bin/dnscollector " $@ "
You can’t perform that action at this time.
0 commit comments