Compare commits

..

No commits in common. "8173a013376a7a3cd13132d3aba47e52d1c67f0f" and "135c0ec08f86a98e3406c9b7e986402e5db80c59" have entirely different histories.

3 changed files with 22 additions and 22 deletions

View file

@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
uses: actions/setup-go@v4
with:
go-version: "1.19.x"
@ -44,7 +44,7 @@ jobs:
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
uses: actions/setup-go@v4
with:
go-version: "1.19.x"

View file

@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
uses: actions/setup-go@v4
with:
go-version: "1.19.x"

View file

@ -1,30 +1,30 @@
# syntax=docker/dockerfile:1
FROM alpine:3.18.4 as builder
# Build the application from source
FROM golang:1.21.4 AS build-stage
WORKDIR /go/src/github.com/systemli/prometheus-mastodon-exporter
WORKDIR /app
ENV USER=appuser
ENV UID=10001
COPY go.mod go.sum ./
RUN go mod download
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
"${USER}"
COPY *.go ./
RUN apk add --no-cache --update ca-certificates
RUN CGO_ENABLED=0 GOOS=linux go build -o /prometheus-mastodon-exporter
FROM scratch
# Run the tests in the container
FROM build-stage AS run-test-stage
RUN go test -v ./...
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY prometheus-mastodon-exporter /prometheus-mastodon-exporter
# Deploy the application binary into a lean image
FROM gcr.io/distroless/base-debian11 AS build-release-stage
WORKDIR /
COPY --from=build-stage /prometheus-mastodon-exporter /prometheus-mastodon-exporter
USER appuser:appuser
EXPOSE 13120
USER nonroot:nonroot
ENTRYPOINT ["/prometheus-mastodon-exporter"]