mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-08-29 20:27:16 +00:00
48 lines
1.2 KiB
Docker
48 lines
1.2 KiB
Docker
# Build stage
|
|
FROM golang:1.24-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy go mod files
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the hold service
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o atcr-hold ./cmd/hold
|
|
|
|
# Runtime stage
|
|
FROM alpine:latest
|
|
|
|
RUN apk --no-cache add ca-certificates
|
|
|
|
WORKDIR /root/
|
|
|
|
# Copy binary from builder
|
|
COPY --from=builder /app/atcr-hold .
|
|
|
|
# Copy default config
|
|
COPY config/hold.yml /etc/atcr/hold.yml
|
|
|
|
# Create directories for storage
|
|
RUN mkdir -p /var/lib/atcr/hold
|
|
|
|
# Expose default port
|
|
EXPOSE 8080
|
|
|
|
# OCI image annotations
|
|
LABEL org.opencontainers.image.title="ATCR Hold Service" \
|
|
org.opencontainers.image.description="ATCR Hold Service - Bring Your Own Storage component for ATCR" \
|
|
org.opencontainers.image.authors="ATCR Contributors" \
|
|
org.opencontainers.image.source="https://github.com/example/atcr" \
|
|
org.opencontainers.image.documentation="https://atcr.io/docs/hold" \
|
|
org.opencontainers.image.licenses="MIT" \
|
|
org.opencontainers.image.version="0.1.0" \
|
|
io.atcr.icon="https://atcr.io/images/hold-icon.png"
|
|
|
|
# Run the hold service
|
|
ENTRYPOINT ["./atcr-hold"]
|
|
CMD ["/etc/atcr/hold.yml"]
|