15 lines
523 B
Docker
15 lines
523 B
Docker
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.10.0 AS xx
|
|
FROM --platform=$BUILDPLATFORM golang:1.27.4-alpine AS build
|
|
ARG TARGETPLATFORM
|
|
ARG GOPROXY
|
|
COPY --from=xx / /
|
|
WORKDIR /app
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY ./ ./
|
|
RUN CGO_ENABLED=0 GOOS=linux xx-go build -trimpath -ldflags "-w -s" -o /dirlist ./
|
|
|
|
FROM jonasled.dev/infra/images/scratch-rootless:latest@sha256:9e291c85277e40987bdbc84af228b4b40db5c24e1634d047465e2198ed9302e8
|
|
COPY --from=build /dirlist /dirlist
|
|
EXPOSE 2222 9090
|
|
ENTRYPOINT ["/dirlist"]
|