Skip to content

Commit 69bb484

Browse files
committed
freeradius-exporter: container
1 parent 18ee4f7 commit 69bb484

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(import './docker-build-simple.libsonnet')('freeradius-exporter')
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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}}:docker/freeradius-exporter",
33+
"platforms": "linux/arm64",
34+
"push": true,
35+
"tags": "${{ steps.login-ecr.outputs.registry }}/freeradius-exporter:${{ github.sha }},${{ steps.login-ecr.outputs.registry }}/freeradius-exporter:latest"
36+
}
37+
}
38+
]
39+
}
40+
},
41+
"name": "docker-freeradius-exporter",
42+
"on": {
43+
"push": {
44+
"branches": [
45+
"master",
46+
"test"
47+
],
48+
"paths": [
49+
"docker/freeradius-exporter/**",
50+
".github/workflows/docker-freeradius-exporter.yml"
51+
]
52+
}
53+
}
54+
}

freeradius-exporter/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/golang:1.20-bullseye as builder
2+
3+
ENV GOOS=linux
4+
ENV GOARCH=arm64
5+
ENV CGO_ENABLED=0
6+
RUN go install github.com/bvantagelimited/freeradius_exporter@0ba8725aa1ab59e09f4f9f2a1a229ecb66b66d56
7+
8+
FROM gcr.io/distroless/base-debian11
9+
10+
COPY --from=builder /go/bin/linux_arm64/freeradius_exporter /usr/local/bin/
11+
CMD /usr/local/bin/freeradius_exporter

0 commit comments

Comments
 (0)