From 4a0fcfbf602a55bd68c7be33f206808827035717 Mon Sep 17 00:00:00 2001 From: HPPinata <83947761+HPPinata@users.noreply.github.com> Date: Sat, 23 Dec 2023 13:08:33 +0100 Subject: [PATCH] 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. --- Dockerfile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2ef66ad..e9fb8dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,16 +30,14 @@ RUN echo "Building version '$ENV_BUILD_IDENTIFIER-$ENV_BUILD_VERSION' for platfo ######- # Here starts the main image ######- -FROM scratch +FROM alpine:3.19 + +# Install OS-level dependencies +RUN apk add --no-cache bash openresolv # Setup timezone 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 --from=builder /build/dist/wg-portal /app/wg-portal @@ -53,4 +51,4 @@ EXPOSE 8888/tcp VOLUME [ "/app/data", "/app/config" ] # Command to run the executable -ENTRYPOINT [ "/app/wg-portal" ] \ No newline at end of file +ENTRYPOINT [ "/app/wg-portal" ]