From 077fbea0a773470b70d42824a510c6ecb6e5b17f Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Mon, 20 Jan 2020 20:31:35 +0000 Subject: [PATCH] update(docker/builder): back to centos:7 as base image Co-authored-by: Lorenzo Fontana Signed-off-by: Leonardo Di Donato --- docker/builder/Dockerfile | 29 +++++++++++++++++++++----- docker/builder/root/usr/bin/scl_enable | 6 ++++++ 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 docker/builder/root/usr/bin/scl_enable diff --git a/docker/builder/Dockerfile b/docker/builder/Dockerfile index c4e78cb7..e55ef56f 100644 --- a/docker/builder/Dockerfile +++ b/docker/builder/Dockerfile @@ -1,4 +1,4 @@ -FROM centos:8 +FROM centos:7 LABEL name="falcosecurity/falco-builder" LABEL usage="docker run -v $PWD/..:/source -v $PWD/build:/build falcosecurity/falco-builder cmake" @@ -18,12 +18,31 @@ ENV BUILD_WARNINGS_AS_ERRORS=${BUILD_WARNINGS_AS_ERRORS} ENV MAKE_JOBS=${MAKE_JOBS} ENV FALCO_VERSION=${FALCO_VERSION} -RUN dnf update -y -RUN dnf install 'dnf-command(config-manager)' -y -RUN dnf config-manager --set-enabled PowerTools -y -RUN dnf install -y gcc gcc-c++ clang llvm git make which libcurl-devel zlib-devel rpm-build libyaml-devel openssl-devel cmake ncurses-devel c-ares-devel autoconf automake libtool createrepo expect which glibc-static libstdc++-static elfutils-libelf-devel -y +# build toolchain +RUN yum -y install centos-release-scl && \ + INSTALL_PKGS="devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-toolchain devtoolset-7-libstdc++-devel devtoolset-7-elfutils-libelf-devel glibc-static autoconf automake libtool createrepo expect git which libcurl-devel zlib-devel rpm-build libyaml-devel" && \ + yum -y install --setopt=tsflags=nodocs $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS + +ARG CMAKE_VERSION=3.5.1 +RUN source scl_source enable devtoolset-7 && \ + cd /tmp && \ + curl -L https://github.com/kitware/cmake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz | tar xz; \ + cd cmake-${CMAKE_VERSION} && \ + ./bootstrap --system-curl && \ + make -j${MAKE_JOBS} && \ + make install && \ + rm -rf /tmp/cmake-${CMAKE_VERSION} + +# build dependencies +RUN yum -y install ncurses-devel libcurl-devel c-ares-devel -y COPY ./root / +# DTS +ENV BASH_ENV=/usr/bin/scl_enable \ + ENV=/usr/bin/scl_enable \ + PROMPT_COMMAND=". /usr/bin/scl_enable" + ENTRYPOINT ["entrypoint"] CMD ["usage"] diff --git a/docker/builder/root/usr/bin/scl_enable b/docker/builder/root/usr/bin/scl_enable new file mode 100644 index 00000000..6646e1a9 --- /dev/null +++ b/docker/builder/root/usr/bin/scl_enable @@ -0,0 +1,6 @@ +# IMPORTANT: Do not add more content to this file unless you know what you are doing. +# This file is sourced everytime the shell session is opened. +# +# This will make scl collection binaries work out of box. +unset BASH_ENV PROMPT_COMMAND ENV +source scl_source enable devtoolset-7