update: use from scratch
This commit is contained in:
19
Dockerfile
19
Dockerfile
@@ -6,21 +6,14 @@ COPY go.mod ./
|
||||
RUN go mod download
|
||||
|
||||
COPY pkg pkg
|
||||
COPY main.go main.go
|
||||
COPY cmd cmd
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o arcgis-utils
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o arcgis-utils ./cmd/arcgis-utils
|
||||
|
||||
# Create wrapper script in builder stage
|
||||
RUN echo '#!/bin/sh' > /app/arcgis-utils-wrapper && \
|
||||
echo 'exec /usr/local/bin/arcgis-utils -output="/results" "$@"' >> /app/arcgis-utils-wrapper && \
|
||||
chmod +x /app/arcgis-utils-wrapper
|
||||
FROM scratch
|
||||
|
||||
FROM chainguard/wolfi-base:latest
|
||||
|
||||
WORKDIR /results
|
||||
|
||||
COPY --from=builder /app/arcgis-utils /usr/local/bin/arcgis-utils
|
||||
COPY --from=builder /app/arcgis-utils-wrapper /usr/local/bin/arcgis-utils-wrapper
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
COPY --from=builder /app/arcgis-utils /arcgis-utils
|
||||
|
||||
LABEL org.opencontainers.image.title="ArcGIS Utils"
|
||||
LABEL org.opencontainers.image.description="A Go-based tool for downloading data from various public ArcGIS sources and converting it to common geospatial formats"
|
||||
@@ -28,4 +21,4 @@ LABEL org.opencontainers.image.source="https://github.com/Sudo-Ivan/arcgis-utils
|
||||
LABEL org.opencontainers.image.licenses="MIT"
|
||||
LABEL org.opencontainers.image.authors="Sudo-Ivan"
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/arcgis-utils-wrapper"]
|
||||
ENTRYPOINT ["/arcgis-utils"]
|
||||
Reference in New Issue
Block a user