2019-04-06 06:09:21 +00:00
|
|
|
ARG REGISTRY_PREFIX=''
|
2019-03-03 12:42:46 +00:00
|
|
|
ARG CODENAME=bionic
|
|
|
|
|
2019-04-06 06:09:21 +00:00
|
|
|
FROM ${REGISTRY_PREFIX}ubuntu:${CODENAME} as builder
|
2019-03-03 12:42:46 +00:00
|
|
|
|
|
|
|
RUN set -x \
|
|
|
|
&& apt update \
|
2019-03-19 23:58:06 +00:00
|
|
|
&& apt upgrade -y \
|
2019-03-03 12:42:46 +00:00
|
|
|
&& apt install --yes --no-install-recommends \
|
|
|
|
build-essential \
|
|
|
|
cmake \
|
|
|
|
ninja-build \
|
2019-03-19 23:58:06 +00:00
|
|
|
pkg-config \
|
2019-03-28 06:43:21 +00:00
|
|
|
rsync \
|
2019-04-02 20:21:02 +00:00
|
|
|
gdb \
|
|
|
|
gdbserver \
|
|
|
|
valgrind
|
2019-03-03 12:42:46 +00:00
|
|
|
|
2019-03-20 23:43:53 +00:00
|
|
|
COPY src /usr/local/src
|
2019-03-03 12:42:46 +00:00
|
|
|
|
2019-03-20 23:43:53 +00:00
|
|
|
ARG PARALLELMFLAGS=-j2
|
2019-03-03 12:42:46 +00:00
|
|
|
|
2019-04-06 06:09:21 +00:00
|
|
|
ARG DUMB_INIT_VERSION=1.2.2
|
2019-04-02 20:21:02 +00:00
|
|
|
|
|
|
|
RUN set -x \
|
|
|
|
&& builddeps="xxd" \
|
|
|
|
&& apt install --yes --no-install-recommends $builddeps \
|
|
|
|
&& builddir="/tmp/out" \
|
|
|
|
&& mkdir -p "$builddir" \
|
|
|
|
&& cd "$builddir" \
|
2019-04-06 06:09:21 +00:00
|
|
|
&& cp -R "/usr/local/src/dumb-init-$DUMB_INIT_VERSION" . \
|
|
|
|
&& cd "dumb-init-$DUMB_INIT_VERSION" \
|
2019-04-02 20:21:02 +00:00
|
|
|
&& make "$PARALLELMFLAGS" \
|
|
|
|
&& chmod +x dumb-init \
|
|
|
|
&& mv dumb-init /usr/local/bin/dumb-init \
|
|
|
|
&& dumb-init --version \
|
|
|
|
&& rm -rf "$builddir" \
|
|
|
|
&& apt purge -y $builddeps
|
|
|
|
|
2019-03-23 01:17:44 +00:00
|
|
|
ARG GTEST_VERSION=1.8.1
|
|
|
|
|
2019-03-20 23:43:53 +00:00
|
|
|
RUN set -x \
|
2019-04-02 20:21:02 +00:00
|
|
|
&& builddir="/tmp/out" \
|
|
|
|
&& mkdir -p "$builddir" \
|
|
|
|
&& cd "$builddir" \
|
2019-03-23 01:17:44 +00:00
|
|
|
&& cmake "/usr/local/src/googletest-release-$GTEST_VERSION" \
|
|
|
|
&& make "$PARALLELMFLAGS" install \
|
2019-04-02 20:21:02 +00:00
|
|
|
&& rm -rf "$builddir"
|
2019-03-03 12:42:46 +00:00
|
|
|
|
2019-03-23 01:17:44 +00:00
|
|
|
ARG FUSE_VERSION=3.1.1
|
|
|
|
|
2019-03-03 12:42:46 +00:00
|
|
|
RUN set -x \
|
2019-04-02 20:21:02 +00:00
|
|
|
&& builddeps="libtool automake gettext" \
|
|
|
|
&& apt install --yes --no-install-recommends $builddeps \
|
2019-03-23 01:17:44 +00:00
|
|
|
&& cd "/usr/local/src/libfuse-fuse-$FUSE_VERSION" \
|
2019-03-20 23:43:53 +00:00
|
|
|
&& ./makeconf.sh \
|
2019-04-02 20:21:02 +00:00
|
|
|
&& builddir="/tmp/out" \
|
|
|
|
&& mkdir -p "$builddir" \
|
|
|
|
&& cd "$builddir" \
|
2019-03-23 01:17:44 +00:00
|
|
|
&& "/usr/local/src/libfuse-fuse-$FUSE_VERSION/configure" \
|
|
|
|
&& make "$PARALLELMFLAGS" install \
|
2019-04-02 20:21:02 +00:00
|
|
|
&& rm -rf "$builddir" \
|
|
|
|
&& apt purge -y $builddeps
|
2019-03-03 12:42:46 +00:00
|
|
|
|
2019-03-23 01:17:44 +00:00
|
|
|
ARG WEBSOCKETS_VERSION=3.1.0
|
|
|
|
|
2019-03-03 12:42:46 +00:00
|
|
|
RUN set -x \
|
|
|
|
&& apt install --yes --no-install-recommends \
|
2019-04-02 20:21:02 +00:00
|
|
|
ca-certificates \
|
2019-03-20 23:43:53 +00:00
|
|
|
openssl \
|
2019-03-03 12:42:46 +00:00
|
|
|
libssl-dev \
|
2019-04-02 20:21:02 +00:00
|
|
|
&& builddir="/tmp/out" \
|
|
|
|
&& mkdir -p "$builddir" \
|
|
|
|
&& cd "$builddir" \
|
2019-03-23 01:17:44 +00:00
|
|
|
&& cmake "/usr/local/src/libwebsockets-$WEBSOCKETS_VERSION" \
|
|
|
|
&& make "$PARALLELMFLAGS" install \
|
2019-04-02 20:21:02 +00:00
|
|
|
&& rm -rf "$builddir"
|
2019-03-03 12:42:46 +00:00
|
|
|
|
2019-03-23 01:17:44 +00:00
|
|
|
ARG JANSSON_VERSION=2.12
|
|
|
|
|
2019-03-03 12:42:46 +00:00
|
|
|
RUN set -x \
|
2019-04-02 20:21:02 +00:00
|
|
|
&& builddir="/tmp/out" \
|
|
|
|
&& mkdir -p "$builddir" \
|
|
|
|
&& cd "$builddir" \
|
2019-03-23 01:17:44 +00:00
|
|
|
&& cmake -DJANSSON_BUILD_DOCS=OFF "/usr/local/src/jansson-$JANSSON_VERSION" \
|
|
|
|
&& make "$PARALLELMFLAGS" install \
|
2019-04-02 20:21:02 +00:00
|
|
|
&& rm -rf "$builddir"
|
2019-03-03 12:42:46 +00:00
|
|
|
|
2019-03-23 01:17:44 +00:00
|
|
|
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
|
2019-03-03 12:42:46 +00:00
|
|
|
|
2019-03-20 00:32:55 +00:00
|
|
|
ARG USERID=1000
|
|
|
|
|
2019-03-28 06:43:21 +00:00
|
|
|
ARG PROJECT_ROOT=/workspace/src
|
|
|
|
ARG OUT=/workspace/out
|
2019-03-23 01:17:44 +00:00
|
|
|
|
|
|
|
RUN set -x \
|
|
|
|
&& useradd -u "$USERID" -ms /bin/bash user \
|
2019-03-28 06:43:21 +00:00
|
|
|
&& mkdir -p "$PROJECT_ROOT" "$OUT" \
|
|
|
|
&& chown user:user "$PROJECT_ROOT" "$OUT"
|
2019-03-03 12:42:46 +00:00
|
|
|
|
2019-03-28 06:43:21 +00:00
|
|
|
WORKDIR "$OUT"
|
2019-03-03 12:42:46 +00:00
|
|
|
|
2019-04-02 20:21:02 +00:00
|
|
|
ENTRYPOINT ["dumb-init", "--"]
|
|
|
|
|