diff --git a/tools/docker/build-and-push-images.sh b/tools/docker/build-and-push-images.sh new file mode 100755 index 000000000..af0057ca4 --- /dev/null +++ b/tools/docker/build-and-push-images.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# Please run from the directory this file in +docker pull ubuntu:18.04 +docker build -t jevolk/construct:ubuntu-18.04 ./ubuntu/base +docker build -t jevolk/construct:ubuntu-18.04-clang-9 ./ubuntu/clang-9 +docker build -t jevolk/construct:ubuntu-18.04-gcc-8 ./ubuntu/gcc-8 + +docker push jevolk/construct:ubuntu-18.04-clang-9 +docker push jevolk/construct:ubuntu-18.04-gcc-8 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 87% rename from tools/docker/ubuntu-18.04-clang-9 rename to tools/docker/ubuntu/base/Dockerfile index e9d1c7a7d..65616cfef 100644 --- a/tools/docker/ubuntu-18.04-clang-9 +++ b/tools/docker/ubuntu/base/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:18.04 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 +14,6 @@ RUN \ autotools-dev \ boost1.68 \ build-essential \ - clang-9 \ cmake \ curl \ git \ @@ -30,8 +29,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 +54,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/*