diff --git a/tools/docker/build-and-push-images.sh b/tools/docker/build-and-push-images.sh new file mode 100755 index 000000000..133497e2d --- /dev/null +++ b/tools/docker/build-and-push-images.sh @@ -0,0 +1,12 @@ +#!/bin/sh +BASEDIR=$(dirname "$0") + +docker pull ubuntu:18.04 +docker build -t jevolk/construct:ubuntu-18.04 $BASEDIR/ubuntu/base +docker build -t jevolk/construct:ubuntu-18.04-clang-9 $BASEDIR/ubuntu/clang-9 +docker build -t jevolk/construct:ubuntu-18.04-gcc-8 $BASEDIR/ubuntu/gcc-8 +docker build -t jevolk/construct:ubuntu-18.04-gcc-9 $BASEDIR/ubuntu/gcc-9 + +docker push jevolk/construct:ubuntu-18.04-clang-9 +docker push jevolk/construct:ubuntu-18.04-gcc-8 +docker push jevolk/construct:ubuntu-18.04-gcc-9 diff --git a/tools/docker/ubuntu-18.04-gcc-8 b/tools/docker/ubuntu-18.04-gcc-8 deleted file mode 100644 index fed255060..000000000 --- a/tools/docker/ubuntu-18.04-gcc-8 +++ /dev/null @@ -1,62 +0,0 @@ -FROM ubuntu:18.04 - -RUN \ - apt-get update && \ - apt-get install -y software-properties-common && \ - add-apt-repository -y ppa:mhier/libboost-latest && \ - add-apt-repository -y ppa:ubuntu-toolchain-r/test && \ - apt-get update && \ - apt-get install --no-install-recommends -y \ - autoconf \ - autoconf-archive \ - autoconf2.13 \ - automake \ - autotools-dev \ - boost1.68 \ - build-essential \ - cmake \ - curl \ - g++-8 \ - gcc-8 \ - git \ - libbz2-dev \ - libgflags-dev \ - libgraphicsmagick1-dev \ - libjemalloc-dev \ - liblz4-dev \ - libmagic-dev \ - libnss-db \ - libsodium-dev \ - libssl-dev \ - libtool \ - shtool \ - xz-utils && \ - apt-get clean && \ - apt-get autoremove --purge -y - -ENV ROCKSDB_VERSION=5.16.6 - -RUN \ - mkdir -p /tmpbuild/rocksdb && \ - cd /tmpbuild/rocksdb && \ - curl -sL https://github.com/facebook/rocksdb/archive/v${ROCKSDB_VERSION}.tar.gz -o rocksdb-${ROCKSDB_VERSION}.tar.gz && \ - tar xfvz rocksdb-${ROCKSDB_VERSION}.tar.gz && \ - cd /tmpbuild/rocksdb/rocksdb-${ROCKSDB_VERSION} && \ - cmake -H. -Bbuild \ - -DCMAKE_BUILD_TYPE=Release \ - -DWITH_TESTS=0 \ - -DWITH_TOOLS=0 \ - -DUSE_RTTI=1 \ - -DWITH_LZ4=1 \ - -DBUILD_SHARED_LIBS=1 && \ - cmake --build build --target install && \ - rm -Rf /tmpbuild/ - -RUN mkdir /build - -ENV CXX g++-8 -ENV CC gcc-8 - -WORKDIR /build - -CMD [ "/bin/bash" ] diff --git a/tools/docker/ubuntu-18.04-clang-9 b/tools/docker/ubuntu/base/Dockerfile similarity index 85% rename from tools/docker/ubuntu-18.04-clang-9 rename to tools/docker/ubuntu/base/Dockerfile index e9d1c7a7d..80f0324a8 100644 --- a/tools/docker/ubuntu-18.04-clang-9 +++ b/tools/docker/ubuntu/base/Dockerfile @@ -1,8 +1,10 @@ FROM ubuntu:18.04 +ENV DEBIAN_FRONTEND=noninteractive + RUN \ apt-get update && \ - apt-get install -y software-properties-common && \ + apt-get install --no-install-recommends -y software-properties-common && \ add-apt-repository -y ppa:mhier/libboost-latest && \ add-apt-repository -y ppa:ubuntu-toolchain-r/test && \ apt-get update && \ @@ -14,7 +16,6 @@ RUN \ autotools-dev \ boost1.68 \ build-essential \ - clang-9 \ cmake \ curl \ git \ @@ -30,8 +31,10 @@ RUN \ libtool \ shtool \ xz-utils && \ + apt-get purge -y software-properties-common && \ apt-get clean && \ - apt-get autoremove --purge -y + apt-get autoremove --purge -y && \ + rm -rf /var/lib/apt/lists/* ENV ROCKSDB_VERSION=5.16.6 @@ -53,9 +56,5 @@ RUN \ RUN mkdir /build -ENV CC clang-9 -ENV CXX clang++-9 - WORKDIR /build -CMD [ "/bin/bash" ] diff --git a/tools/docker/ubuntu/clang-9/Dockerfile b/tools/docker/ubuntu/clang-9/Dockerfile new file mode 100644 index 000000000..9b1dd187e --- /dev/null +++ b/tools/docker/ubuntu/clang-9/Dockerfile @@ -0,0 +1,10 @@ +FROM jevolk/construct:ubuntu-18.04 + +ENV CC clang-9 +ENV CXX clang++-9 + +RUN apt-get update \ + && apt-get install --no-install-recommends -y clang-9 \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + diff --git a/tools/docker/ubuntu/gcc-8/Dockerfile b/tools/docker/ubuntu/gcc-8/Dockerfile new file mode 100644 index 000000000..b24cab63c --- /dev/null +++ b/tools/docker/ubuntu/gcc-8/Dockerfile @@ -0,0 +1,9 @@ +FROM jevolk/construct:ubuntu-18.04 + +ENV CXX g++-8 +ENV CC gcc-8 + +RUN apt-get update \ + && apt-get install --no-install-recommends -y g++-8 gcc-8 \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* diff --git a/tools/docker/ubuntu/gcc-9/Dockerfile b/tools/docker/ubuntu/gcc-9/Dockerfile new file mode 100644 index 000000000..8c64776df --- /dev/null +++ b/tools/docker/ubuntu/gcc-9/Dockerfile @@ -0,0 +1,12 @@ +FROM jevolk/construct:ubuntu-18.04 + +ENV CXX g++-9 +ENV CC gcc-9 + +RUN apt-get update \ + && apt-get install --no-install-recommends -y software-properties-common \ + && add-apt-repository ppa:jonathonf/gcc-9.2 \ + && apt-get update \ + && apt-get install --no-install-recommends -y g++- gcc-9 \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/*