Update WGET from Busybox to APK

This commit is contained in:
Katos
2024-07-07 17:18:18 +01:00
committed by GitHub
parent 5c0d161eb4
commit 69e5a877c0
2 changed files with 3 additions and 15 deletions

View File

@@ -13,7 +13,6 @@ FROM golang:alpine AS builder
ARG BUILD_TIME ARG BUILD_TIME
ARG COMMIT ARG COMMIT
ARG VERSION ARG VERSION
ARG BUSYBOX_VERSION=1.36.1-r31
RUN apk update && \ RUN apk update && \
apk upgrade && \ apk upgrade && \
apk add --update git build-base gcc g++ apk add --update git build-base gcc g++
@@ -28,14 +27,8 @@ RUN CGO_ENABLED=0 GOOS=linux go build \
-o /go/bin/api \ -o /go/bin/api \
-v ./app/api/*.go -v ./app/api/*.go
# Downloading Wget
ADD https://busybox.net/downloads/binaries/$BUSYBOX_VERSION/busybox_WGET /wget
RUN chmod a+x /wget
FROM gcr.io/distroless/java:latest FROM gcr.io/distroless/java:latest
COPY --from=builder /wget /usr/bin/wget
# Production Stage # Production Stage
FROM alpine:latest FROM alpine:latest
@@ -46,9 +39,9 @@ ENV HBOX_STORAGE_SQLITE_URL=/data/homebox.db?_pragma=busy_timeout=2000&_pragma=j
RUN apk --no-cache add ca-certificates RUN apk --no-cache add ca-certificates
RUN mkdir /app RUN mkdir /app
COPY --from=builder /go/bin/api /app COPY --from=builder /go/bin/api /app
COPY --from=builder /wget /usr/bin/wget
RUN chmod +x /app/api RUN chmod +x /app/api
RUN apk add --no-cache wget
LABEL Name=homebox Version=0.0.1 LABEL Name=homebox Version=0.0.1
LABEL org.opencontainers.image.source="https://github.com/sysadminsmedia/homebox" LABEL org.opencontainers.image.source="https://github.com/sysadminsmedia/homebox"

View File

@@ -31,14 +31,8 @@ RUN CGO_ENABLED=0 GOOS=linux go build \
# create a directory so that we can copy it in the next stage # create a directory so that we can copy it in the next stage
mkdir /data mkdir /data
# Downloading Wget
ADD https://busybox.net/downloads/binaries/$BUSYBOX_VERSION/busybox_WGET /wget
RUN chmod a+x /wget
FROM gcr.io/distroless/java:latest FROM gcr.io/distroless/java:latest
COPY --from=builder /wget /usr/bin/wget
# Production Stage # Production Stage
FROM gcr.io/distroless/static:latest FROM gcr.io/distroless/static:latest
@@ -50,7 +44,8 @@ ENV HBOX_STORAGE_SQLITE_URL=/data/homebox.db?_fk=1
# change the ownership to the low-privileged user # change the ownership to the low-privileged user
COPY --from=builder --chown=nonroot /go/bin/api /app COPY --from=builder --chown=nonroot /go/bin/api /app
COPY --from=builder --chown=nonroot /data /data COPY --from=builder --chown=nonroot /data /data
COPY --from=builder --chown=nonroot /wget /usr/bin/wget
RUN apk add --no-cache wget
LABEL Name=homebox Version=0.0.1 LABEL Name=homebox Version=0.0.1
LABEL org.opencontainers.image.source="https://github.com/sysadminsmedia/homebox" LABEL org.opencontainers.image.source="https://github.com/sysadminsmedia/homebox"