Simplify and dry up the Dockerfiles

This commit is contained in:
Wessel Nieboer 2020-04-08 03:13:55 +02:00
parent eeac3c1eaa
commit a1858b9f89
5 changed files with 32 additions and 69 deletions

View File

@ -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

View File

@ -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" ]

View File

@ -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" ]

View File

@ -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/*

View File

@ -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/*