mirror of
https://github.com/ledgersmb/ledgersmb-docker.git
synced 2025-08-20 07:37:24 -04:00
Rewrite proxy Dockerfile:
* ARCH used to be hard-coded; is now set according to the architecture being built * Build from the associated LedgerSMB base image (not from 'lsmb-split') * More deletion of non-required files (/usr/share/doc/*) * Fewer layers by combining RUN commands
This commit is contained in:
parent
3a966483d2
commit
0b4f0321fc
@ -1,49 +1,47 @@
|
||||
FROM lsmb-split:latest
|
||||
#FROM ledgersmb/ledgersmb:1.11.18
|
||||
USER root
|
||||
|
||||
# Remove inherited start.sh
|
||||
RUN rm -rf /usr/local/bin/start.sh
|
||||
|
||||
# Install nginx and other dependencies
|
||||
RUN set -x && \
|
||||
apt-get update -y && \
|
||||
apt-get dist-upgrade -y && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
nginx wget xz-utils
|
||||
mkdir -p /var/lib/nginx/body /var/cache/nginx
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
# Install LedgerSMB version
|
||||
ARG LSMB_VERSION=1.13.0-beta1
|
||||
# Install s6-overlay
|
||||
ARG S6_OVERLAY_VERSION=3.2.0.2
|
||||
|
||||
RUN set -ex && \
|
||||
ARCH="x86_64" && \
|
||||
wget -O /tmp/s6-overlay-noarch.tar.xz https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz && \
|
||||
wget -O /tmp/s6-overlay-noarch.tar.xz.sha256 https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz.sha256 && \
|
||||
wget -O /tmp/s6-overlay-${ARCH}.tar.xz https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${ARCH}.tar.xz && \
|
||||
wget -O /tmp/s6-overlay-${ARCH}.tar.xz.sha256 https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${ARCH}.tar.xz.sha256 && \
|
||||
wget -O /tmp/s6-overlay-symlinks-noarch.tar.xz https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz && \
|
||||
wget -O /tmp/s6-overlay-symlinks-noarch.tar.xz.sha256 https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz.sha256 && \
|
||||
cd /tmp && \
|
||||
sha256sum -c *.sha256 && \
|
||||
tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && \
|
||||
tar -C / -Jxpf /tmp/s6-overlay-${ARCH}.tar.xz && \
|
||||
tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz
|
||||
FROM ledgersmb/ledgersmb:$LSMB_VERSION
|
||||
|
||||
# Repeat args if we still want to use them
|
||||
ARG LSMB_VERSION
|
||||
ARG S6_OVERLAY_VERSION
|
||||
|
||||
# Install nginx and other dependencies
|
||||
USER root
|
||||
RUN set -x && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get update -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nginx wget xz-utils && \
|
||||
mkdir -p /var/lib/nginx/body /var/cache/nginx && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get autoremove -q -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get clean -q && \
|
||||
ARCH="$(case "$(dpkg --print-architecture)" in armv7*) echo "armhf" ;; arm64) echo "aarch64" ;; amd64) echo "x86_64" ;; *) exit 1 ;; esac)" && \
|
||||
wget -O /tmp/s6-overlay-noarch.tar.xz https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz && \
|
||||
wget -O /tmp/s6-overlay-noarch.tar.xz.sha256 https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz.sha256 && \
|
||||
wget -O /tmp/s6-overlay-${ARCH}.tar.xz https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${ARCH}.tar.xz && \
|
||||
wget -O /tmp/s6-overlay-${ARCH}.tar.xz.sha256 https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${ARCH}.tar.xz.sha256 && \
|
||||
wget -O /tmp/s6-overlay-symlinks-noarch.tar.xz https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz && \
|
||||
wget -O /tmp/s6-overlay-symlinks-noarch.tar.xz.sha256 https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz.sha256 && \
|
||||
cd /tmp && \
|
||||
sha256sum -c *.sha256 && \
|
||||
tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && \
|
||||
tar -C / -Jxpf /tmp/s6-overlay-${ARCH}.tar.xz && \
|
||||
tar -C / -Jxpf /tmp/s6-overlay-symlinks-noarch.tar.xz && \
|
||||
rm -rf ~/.cpanm/ /var/lib/apt/lists/* /usr/share/man/* /usr/share/doc/* /tmp/s6-overlay-*.tar.xz*
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
# Configure nginx and starman with s6
|
||||
COPY services/starman/run /etc/services.d/starman/run
|
||||
RUN chmod +x /etc/services.d/starman/run
|
||||
|
||||
COPY services/nginx/run /etc/services.d/nginx/run
|
||||
RUN chmod +x /etc/services.d/nginx/run
|
||||
|
||||
COPY scripts/ledgersmb_config /etc/s6-overlay/s6-rc.d/ledgersmb_config
|
||||
RUN touch /etc/s6-overlay/s6-rc.d/user/contents.d/ledgersmb_config
|
||||
RUN chmod +x /etc/s6-overlay/s6-rc.d/ledgersmb_config/up
|
||||
|
||||
RUN chmod +x /etc/services.d/starman/run /etc/services.d/nginx/run /etc/s6-overlay/s6-rc.d/ledgersmb_config/up && \
|
||||
touch /etc/s6-overlay/s6-rc.d/user/contents.d/ledgersmb_config
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
#USER www-data
|
||||
ENTRYPOINT ["/init"]
|
||||
|
Loading…
Reference in New Issue
Block a user