diff --git a/docker/builder/Dockerfile b/docker/builder/Dockerfile index 12850bc2f37..6b72dd29447 100644 --- a/docker/builder/Dockerfile +++ b/docker/builder/Dockerfile @@ -1,61 +1,54 @@ -FROM centos:6 +FROM centos:7 -ENV FALCO_VERSION 0.1.1dev -ENV BUILD_TYPE Release -ENV BUILD_DRIVER OFF -ENV BUILD_BPF OFF -ENV BUILD_WARNINGS_AS_ERRORS ON -ENV MAKE_JOBS 4 +LABEL name="falcosecurity/falco-builder" +LABEL usage="docker run -v /etc/passwd:/etc/passwd:ro -v $PWD/..:/source -v $PWD/build:/build falcosecurity/falco-builder" + +ARG BUILD_TYPE=release +ARG BUILD_DRIVER=OFF +ARG BUILD_BPF=OFF +ARG BUILD_WARNINGS_AS_ERRORS=ON +ARG MAKE_JOBS=4 + +ENV BUILD_TYPE=${BUILD_TYPE} +ENV BUILD_DRIVER=${BUILD_DRIVER} +ENV BUILD_BPF=${BUILD_BPF} +ENV BUILD_WARNINGS_AS_ERRORS=${BUILD_WARNINGS_AS_ERRORS} +ENV MAKE_JOBS=${MAKE_JOBS} ARG DOCKER_VERSION=1.11.0 -ARG CMAKE_VERSION=3.14.5 - -RUN curl -o /etc/yum.repos.d/devtools-2.repo https://people.centos.org/tru/devtools-2/devtools-2.repo && \ - rpm -i http://mirror.pnl.gov/epel/6/i386/epel-release-6-8.noarch.rpm && \ - sed -e 's,$basearch,i386,' -e 's,$releasever\],$releasever-i686\],' /etc/yum.repos.d/devtools-2.repo > /etc/yum.repos.d/devtools-2-i686.repo && \ - yum -y install \ - createrepo \ - devtoolset-2-toolchain \ - dpkg \ - dpkg-devel \ - expect \ - gcc \ - gcc-c++ \ - git \ - glibc-static \ - libcurl-devel \ - make \ - curl \ - zlib-devel \ - pkg-config \ - rpm-build \ - unzip \ - wget \ - tar \ - autoconf \ - automake \ - libtool && \ - yum -y install \ - glibc-devel.i686 \ - devtoolset-2-libstdc++-devel.i686 \ - devtoolset-2-elfutils-libelf-devel && \ - yum clean all -RUN curl -o docker.tgz https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz && \ - tar xfz docker.tgz docker/docker && \ - mv docker/docker /usr/local/bin/docker && \ - chmod +x /usr/local/bin/docker && \ - rm -fr docker.tgz docker/ -RUN . /opt/rh/devtoolset-2/enable && \ - cd /tmp && \ - wget -nv -O - /~https://github.com/kitware/cmake/releases/download/v$CMAKE_VERSION/cmake-${CMAKE_VERSION}.tar.gz | tar zx; \ - cd /tmp/cmake-${CMAKE_VERSION} && \ - ./bootstrap --system-curl && \ - make -j${MAKE_JOBS} && \ - make install && \ - rm -rf /tmp/cmake-${CMAKE_VERSION} - -# TEMPORARY until dependencies in CMakeLists.txt are fixed +ARG CMAKE_VERSION=3.5.0 + +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" && \ + yum -y install --setopt=tsflags=nodocs $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS + +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} + +RUN cd /tmp && \ + curl -L https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz | tar xz; \ + mv docker/docker /usr/local/bin/docker && \ + chmod +x /usr/local/bin/docker && \ + rm -rf /tmp/docker + +# Note: Needs a fix into CMakeLists.txt # gcc gcc-c++ RUN yum -y install libyaml-devel -COPY entrypoint.sh / -ENTRYPOINT ["/entrypoint.sh"] +RUN yum clean all -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"] \ No newline at end of file