42 lines
995 B
Plaintext
42 lines
995 B
Plaintext
# Alpine-based with shell for debugging
|
|
# SELinux compatible, rootless ready
|
|
|
|
FROM docker.io/library/golang:1.23-alpine AS builder
|
|
|
|
RUN apk add --no-cache git ca-certificates
|
|
|
|
WORKDIR /build
|
|
|
|
COPY go.mod go.sum* ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN CGO_ENABLED=0 go build \
|
|
-ldflags='-w -s' \
|
|
-o argparse-builder \
|
|
.
|
|
|
|
FROM docker.io/library/alpine:3.19
|
|
|
|
LABEL maintainer="your-email@example.com" \
|
|
org.opencontainers.image.title="Argparse Builder (Alpine)" \
|
|
org.opencontainers.image.description="Interactive bash argument parser generator" \
|
|
org.opencontainers.image.version="1.0.0"
|
|
|
|
RUN apk add --no-cache ca-certificates tzdata && \
|
|
adduser -D -u 1000 -h /app argparse
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder --chown=argparse:argparse /build/argparse-builder .
|
|
|
|
USER argparse
|
|
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1
|
|
|
|
ENTRYPOINT ["/app/argparse-builder"]
|