Use Alpine base image (#205)

wgquick (apparently) depends on bash and openresolv.

Without those packages removing an Interface is impossible and causes an error message to appear in the webui:
- No Bash: exec complains about "bash no such file in $PATH"
- No openresolv: resolvconf -f -d *interface* returns with error 127

Not having a Shell in the container also makes debugging a lot more annoying.

This enables deletion of interfaces in the webui, eases debugging and only adds about 3MB in size.
This commit is contained in:
HPPinata 2023-12-23 13:08:33 +01:00 committed by GitHub
parent 1f47075020
commit 4a0fcfbf60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,16 +30,14 @@ RUN echo "Building version '$ENV_BUILD_IDENTIFIER-$ENV_BUILD_VERSION' for platfo
######- ######-
# Here starts the main image # Here starts the main image
######- ######-
FROM scratch FROM alpine:3.19
# Install OS-level dependencies
RUN apk add --no-cache bash openresolv
# Setup timezone # Setup timezone
ENV TZ=Europe/Vienna ENV TZ=Europe/Vienna
# Import linux stuff from builder.
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
# Copy binaries # Copy binaries
COPY --from=builder /build/dist/wg-portal /app/wg-portal COPY --from=builder /build/dist/wg-portal /app/wg-portal