dockerfile: finally produce a working dockerfile
This commit is contained in:
@ -1,68 +1,122 @@
|
||||
# Set the base image to Ubuntu Xenial (16.04)
|
||||
FROM ubuntu:xenial
|
||||
# Set the base image to Ubuntu Jammy. Jammy includes the correct dependency versions except for LLVM.
|
||||
FROM ubuntu:jammy
|
||||
|
||||
MAINTAINER Christian Dietrich <stettberger@dokucode.de>
|
||||
LABEL org.opencontainers.image.authors="Christian Dietrich <stettberger@dokucode.de>"
|
||||
|
||||
# Install Packages required to build FAIL*
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y \
|
||||
build-essential \
|
||||
libmysqlclient-dev \
|
||||
protobuf-compiler \
|
||||
libprotobuf-dev \
|
||||
libpcl1-dev \
|
||||
libboost-thread-dev \
|
||||
libboost-system-dev \
|
||||
libboost-regex-dev \
|
||||
libboost-coroutine-dev \
|
||||
libboost-context-dev \
|
||||
libdwarf-dev \
|
||||
libelf-dev \
|
||||
libfontconfig1-dev \
|
||||
zlib1g-dev \
|
||||
binutils-dev \
|
||||
libiberty-dev \
|
||||
llvm-3.9-dev \
|
||||
clang-3.9 \
|
||||
libsdl1.2-dev \
|
||||
libgtk2.0-dev \
|
||||
libwxgtk3.0-dev \
|
||||
libncurses5-dev \
|
||||
# TODO: Can shrink the image size down by a LOT:
|
||||
# - A lot of dependencies are unnecessary, I just need to figure out which
|
||||
# - Separate build-time / runtime dependencies, then do 2 stages
|
||||
# - Combine multiple RUNs into a single one
|
||||
# - Use apt-get --no-install-recommends during package install and apt-get clean afterwards
|
||||
|
||||
cmake \
|
||||
cmake-curses-gui \
|
||||
doxygen \
|
||||
git \
|
||||
screen \
|
||||
wget \
|
||||
openssh-server \
|
||||
vim \
|
||||
# Install basic packages
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
cmake-curses-gui \
|
||||
wget \
|
||||
git \
|
||||
doxygen \
|
||||
screen \
|
||||
openssh-server \
|
||||
neovim \
|
||||
ranger
|
||||
|
||||
# Symlink clang++ to match docs
|
||||
RUN ln -sf /usr/bin/clang++-3.9 /usr/bin/clang++
|
||||
# NOTE: Only required if the base image is not Jammy
|
||||
# Install Boost 1.74 (focal includes 1.71)
|
||||
# Jammy includes the correct version but its llvm is too old
|
||||
# RUN wget https://archives.boost.io/release/1.74.0/source/boost_1_74_0.tar.gz \
|
||||
# && tar xvzf boost_1_74_0.tar.gz && cd boost_1_74_0 \
|
||||
# && chmod +x ./bootstrap.sh \
|
||||
# && ./bootstrap.sh --prefix=/usr/local \
|
||||
# && ./b2 && ./b2 install
|
||||
# && cd / && rm -rf boost_1_74_0.tar.gz && rm -rf boost_1_74_0
|
||||
# ENV BOOST_ROOT=/usr/local
|
||||
|
||||
# NOTE: Only required if the base image is not Focal
|
||||
# Install LLVM 6.0 from source
|
||||
RUN git clone https://github.com/llvm/llvm-project.git && cd llvm-project \
|
||||
&& git checkout llvmorg-6.0.0 \
|
||||
&& mkdir build && cd build \
|
||||
&& cmake -G "Unix Makefiles" ../llvm \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DLLVM_ENABLE_TERMINFO=OFF \
|
||||
-DLLVM_ENABLE_CURSES=OFF \
|
||||
-DLLVM_ENABLE_PROJECTS="clang;lld" \
|
||||
&& make -j$(nproc) && make install \
|
||||
&& cd / && rm -rf ./llvm-project
|
||||
|
||||
# Install packages required to build FAIL*
|
||||
RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-install-recommends \
|
||||
# binutils-dev \
|
||||
libmysqlclient-dev \
|
||||
libprotobuf-dev \
|
||||
libtinfo-dev \
|
||||
libpcl1-dev \
|
||||
libdwarf-dev \
|
||||
libelf-dev \
|
||||
libiberty-dev \
|
||||
libboost-thread-dev \
|
||||
libboost-system-dev \
|
||||
libboost-regex-dev \
|
||||
libboost-coroutine-dev \
|
||||
libboost-context-dev \
|
||||
libfontconfig1-dev \
|
||||
zlib1g-dev \
|
||||
libz3-dev \
|
||||
libsdl1.2-dev \
|
||||
# libsdl2-dev \
|
||||
libgtk2.0-dev \
|
||||
# libgtk-3-dev \
|
||||
# libwxbase3.0-dev \
|
||||
libwxgtk3.0-gtk3-dev \
|
||||
libncurses-dev \
|
||||
# libncurses5-dev \
|
||||
libx11-dev \
|
||||
xorg-dev \
|
||||
libasound2-dev
|
||||
|
||||
# Install packages required to run FAIL*
|
||||
RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin apt-get install -y --no-install-recommends \
|
||||
protobuf-compiler \
|
||||
libtinfo6 \
|
||||
# libtinfo5 \
|
||||
libmariadb3 \
|
||||
libprotobuf23 \
|
||||
libncurses6 \
|
||||
&& apt-get clean
|
||||
|
||||
# NOTE: Only required if we install llvm from apt
|
||||
# Symlink clang++/llvm-config to match docs
|
||||
# RUN ln -sf /usr/bin/clang++-6.0 /usr/bin/clang++ \
|
||||
# && ln -sf /usr/bin/llvm-config-6.0 /usr/bin/llvm-config
|
||||
|
||||
# Add a user for compiling FAIL*
|
||||
RUN useradd fail; mkdir /home/fail; chown fail /home/fail
|
||||
RUN echo 'fail:fail' | chpasswd; chsh fail --shell /bin/bash
|
||||
RUN adduser fail sudo
|
||||
RUN useradd fail \
|
||||
&& mkdir /home/fail && chown fail /home/fail \
|
||||
&& echo 'fail:fail' | chpasswd && chsh fail --shell /bin/bash \
|
||||
&& adduser fail sudo
|
||||
|
||||
# SSH login fix. Otherwise user is kicked off after login
|
||||
RUN mkdir /var/run/sshd
|
||||
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
|
||||
RUN mkdir /var/run/sshd \
|
||||
&& sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
|
||||
|
||||
ENV NOTVISIBLE "in users profile"
|
||||
ENV NOTVISIBLE="in users profile"
|
||||
RUN echo "export VISIBLE=now" >> /etc/profile
|
||||
|
||||
USER fail
|
||||
ENV HOME /home/fail
|
||||
ENV HOME=/home/fail
|
||||
WORKDIR /home/fail
|
||||
|
||||
# Get AspectC++ (originally v1.2) for 64 Bit
|
||||
ARG acversion="2.0"
|
||||
RUN wget http://www.aspectc.org/releases/"$acversion"/ac-bin-linux-x86-64bit-"$acversion".tar.gz
|
||||
RUN tar xvzf ac-bin-linux-x86-64bit-"$acversion".tar.gz; mkdir bin; mv aspectc++/ac++ aspectc++/ag++ bin/; rm -rf aspectc++
|
||||
ENV PATH /home/fail/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
ARG acversion="2.5"
|
||||
RUN wget http://www.aspectc.org/releases/"$acversion"/ac-bin-linux-x86-64bit-"$acversion".tar.gz \
|
||||
&& tar xvzf ac-bin-linux-x86-64bit-"$acversion".tar.gz \
|
||||
&& mkdir bin && mv aspectc++/ac++ aspectc++/ag++ bin/ \
|
||||
&& rm -rf aspectc++ && rm -rf ac-bin-linux-x86-64bit-"$acversion".tar.gz
|
||||
ENV PATH=/home/fail/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
# Clone FAIL*
|
||||
RUN git clone https://github.com/danceos/fail.git
|
||||
|
||||
Reference in New Issue
Block a user