diff --git a/Dockerfile b/Dockerfile index 5b24dbe..dc1b3a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,12 @@ RUN make static || make static FROM library/alpine -WORKDIR / +WORKDIR /app + +RUN adduser -D --home /app -u 1000 mango COPY --from=builder /Mango/mango /usr/local/bin/mango +USER 1000:1000 + CMD ["/usr/local/bin/mango"] diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index 8f58631..f05af9b 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 @@ -11,5 +11,10 @@ COPY mango-arm32v7.o . RUN cc 'mango-arm32v7.o' -o '/usr/local/bin/mango' -rdynamic -lxml2 -L/image_size.cr/ext/libwebp -lwebp -L/image_size.cr/ext/stbi -lstbi /myhtml/src/ext/modest-c/lib/libmodest_static.a -L/duktape.cr/src/.build/lib -L/duktape.cr/src/.build/include -lduktape -lm `pkg-config libarchive --libs` -lz `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` -lgmp -lsqlite3 -lyaml -lpcre -lm /usr/lib/arm-linux-gnueabihf/libgc.so -lpthread /crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/bin/../lib/crystal/lib -L/usr/bin/../lib/crystal/lib -CMD ["/usr/local/bin/mango"] +RUN useradd --home-dir /app -u 1000 mango + +WORKDIR /app +USER 1000:1000 + +CMD ["/usr/local/bin/mango"] diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 index 29045cf..2c5f0b5 100644 --- a/Dockerfile.arm64v8 +++ b/Dockerfile.arm64v8 @@ -11,4 +11,10 @@ COPY mango-arm64v8.o . RUN cc 'mango-arm64v8.o' -o '/usr/local/bin/mango' -rdynamic -lxml2 -L/image_size.cr/ext/libwebp -lwebp -L/image_size.cr/ext/stbi -lstbi /myhtml/src/ext/modest-c/lib/libmodest_static.a -L/duktape.cr/src/.build/lib -L/duktape.cr/src/.build/include -lduktape -lm `pkg-config libarchive --libs` -lz `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` -lgmp -lsqlite3 -lyaml -lpcre -lm /usr/lib/aarch64-linux-gnu/libgc.so -lpthread /crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/bin/../lib/crystal/lib -L/usr/bin/../lib/crystal/lib +RUN useradd --home-dir /app -u 1000 mango + +WORKDIR /app + +USER 1000:1000 + CMD ["/usr/local/bin/mango"]