1
0
mirror of https://github.com/falk-werner/webfuse-example synced 2024-10-27 20:44:09 +00:00
falk-werner_webfuse-example/Dockerfile

160 lines
4.4 KiB
Docker
Raw Normal View History

2020-02-09 19:24:35 +00:00
ARG REGISTRY_PREFIX=''
ARG CODENAME=bionic
FROM ${REGISTRY_PREFIX}ubuntu:${CODENAME} as builder
2020-04-11 17:15:40 +00:00
ARG DEBIAN_FRONTEND=noninteractive
2020-02-09 19:24:35 +00:00
RUN set -x \
&& apt update \
&& apt upgrade -y \
&& apt install --yes --no-install-recommends \
build-essential \
cmake \
ninja-build \
pkg-config \
ca-certificates \
openssl \
libssl-dev \
uuid-dev \
2020-03-20 16:47:18 +00:00
wget \
libconfig-dev \
2020-04-11 17:15:40 +00:00
libpam0g-dev \
nginx \
2020-07-05 10:35:58 +00:00
fcgiwrap \
python3 \
python3-pip \
python3-setuptools \
python3-wheel \
&& pip3 install --system meson
2020-02-09 19:24:35 +00:00
ARG PARALLELMFLAGS=-j2
ARG S6OVERLAY_VERSION=2.1.0.0
2020-02-09 19:24:35 +00:00
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
2020-04-11 12:04:53 +00:00
&& wget "https://github.com/just-containers/s6-overlay/releases/download/v${S6OVERLAY_VERSION}/s6-overlay-amd64.tar.gz" -O s6overlay.tar.gz \
&& tar -xf s6overlay.tar.gz -C / \
&& rm -rf "$builddir"
ARG SOCKLOG_VERSION=3.1.0-2
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& wget "https://github.com/just-containers/socklog-overlay/releases/download/v${SOCKLOG_VERSION}/socklog-overlay-amd64.tar.gz" -O socklog.tar.gz \
&& tar -xf socklog.tar.gz -C / \
&& rm -rf "$builddir"
2020-02-09 19:24:35 +00:00
ARG FUSE_VERSION=3.10.0
2020-02-09 19:24:35 +00:00
RUN set -x \
2020-07-05 10:35:58 +00:00
&& builddeps="udev gettext " \
2020-02-09 19:24:35 +00:00
&& apt install --yes --no-install-recommends $builddeps \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& wget "https://github.com/libfuse/libfuse/archive/fuse-${FUSE_VERSION}.tar.gz" -O libfuse.tar.gz \
&& tar -xf libfuse.tar.gz \
&& cd "libfuse-fuse-$FUSE_VERSION" \
&& meson -Dexamples=false .build \
&& meson install -C .build \
2020-02-09 19:24:35 +00:00
&& rm -rf "$builddir" \
&& apt purge -y $builddeps
ARG WEBSOCKETS_VERSION=4.1.3
2020-02-09 19:24:35 +00:00
RUN set -x \
&& apt install --yes --no-install-recommends \
ca-certificates \
openssl \
libssl-dev \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& wget "https://github.com/warmcat/libwebsockets/archive/v${WEBSOCKETS_VERSION}.tar.gz" -O libwebsockets.tar.gz \
&& tar -xf libwebsockets.tar.gz \
&& cd "libwebsockets-$WEBSOCKETS_VERSION" \
&& mkdir .build \
&& cd .build \
&& cmake .. \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir"
ARG JANSSON_VERSION=2.13.1
2020-02-09 19:24:35 +00:00
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
&& wget "https://github.com/akheron/jansson/archive/v${JANSSON_VERSION}.tar.gz" -O jansson.tar.gz \
&& tar -xf jansson.tar.gz \
&& cd "jansson-$JANSSON_VERSION" \
&& mkdir .build \
&& cd .build \
&& cmake -DJANSSON_BUILD_DOCS=OFF ".." \
&& make "$PARALLELMFLAGS" install \
&& rm -rf "$builddir"
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
ARG WEBFUSE_VERSION=0.5.1
2020-02-09 19:24:35 +00:00
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
2020-03-01 20:09:41 +00:00
&& wget "https://github.com/falk-werner/webfuse/archive/v${WEBFUSE_VERSION}.tar.gz" -O webfuse.tar.gz \
2020-02-09 19:24:35 +00:00
&& tar -xf webfuse.tar.gz \
&& cd "webfuse-$WEBFUSE_VERSION" \
2020-07-05 10:35:58 +00:00
&& meson -Dwithout_tests=true .build \
2020-02-09 19:24:35 +00:00
&& cd .build \
2020-07-05 10:35:58 +00:00
&& ninja \
&& ninja install \
2020-02-09 19:24:35 +00:00
&& rm -rf "$builddir"
ARG WEBFUSED_VERSION=0.5.0
2020-02-09 19:24:35 +00:00
RUN set -x \
&& builddir="/tmp/out" \
&& mkdir -p "$builddir" \
&& cd "$builddir" \
2020-03-09 17:13:37 +00:00
&& wget "https://github.com/falk-werner/webfused/archive/v${WEBFUSED_VERSION}.tar.gz" -O webfused.tar.gz \
2020-02-09 19:24:35 +00:00
&& tar -xf webfused.tar.gz \
&& cd "webfused-$WEBFUSED_VERSION" \
2020-07-05 10:35:58 +00:00
&& meson -Dwithout_tests=true build \
&& cd build \
&& ninja \
&& ninja install \
2020-02-09 19:24:35 +00:00
&& rm -rf "$builddir"
2020-04-11 08:56:17 +00:00
ARG NPM_VERSION=">=6.14.0 <7.0.0"
ARG NODEJS_VERSION=12
RUN set -x \
&& apt update \
&& apt upgrade -y \
&& apt install --yes --no-install-recommends \
nodejs \
npm \
&& npm install -g npm@"${NPM_VERSION}" \
&& npm install -g n \
&& n "${NODEJS_VERSION}"
COPY www /usr/local/src/www
RUN set -x \
&& cd /usr/local/src/www \
2020-04-11 09:14:28 +00:00
&& npm update --no-save \
2020-04-11 08:56:17 +00:00
&& npm run build \
&& rm -rf /tmp/npm-* \
2020-04-11 17:15:40 +00:00
&& rm -rf /tmp/v8-* \
2020-04-11 08:56:17 +00:00
&& mkdir -p /var/www \
2020-04-11 17:15:40 +00:00
&& cp -r ./dist/. /var/www/ \
&& chmod +x /var/www/cgi-bin/*
2020-04-11 08:56:17 +00:00
2020-03-20 16:47:18 +00:00
ARG USERID=1000
RUN set -x \
&& useradd -u "$USERID" -ms /bin/bash user
2020-04-11 12:04:53 +00:00
COPY etc /etc
2020-02-09 19:24:35 +00:00
EXPOSE 8080
2020-04-11 12:04:53 +00:00
ENTRYPOINT ["/init"]
CMD ["/usr/bin/execlineb", "-P", "-c", "emptyenv export HOME /home/user s6-setuidgid user /bin/bash"]