Commit e5cdb2ad authored by Tommaso Tocci's avatar Tommaso Tocci Committed by Marc Vef
Browse files

docker: added image file for build-env container

The new docker folder will host all the docker image files.
At the moment there is only one image file that allows to build a container based on CentOS 7 that provides a complete build environment for ADAFS. It is bundled with all the required dependencies, both from system repository and the ones that need to be compiled from source. It also provide a suitable compiler (gcc 7.2.1) for later use.

This container can be use as developing environment as well as the base for other images. For instance we can use it to build a container that provide the ADAFS daemon.
parent 3b59ee64
Loading
Loading
Loading
Loading

.dockerignore

0 → 100644
+4 −0
Original line number Diff line number Diff line
.git
.gitignore
build
/archive_old_fs_versions
+107 −0
Original line number Diff line number Diff line
FROM centos:7 as builder


ENV ADAFS_PATH	/opt/adafs

ENV SCRIPTS_PATH	${ADAFS_PATH}/scripts
ENV DEPS_SRC_PATH	${ADAFS_PATH}/deps_src
ENV INSTALL_PATH	${ADAFS_PATH}/build


# Enable epel and scl repository
RUN yum -y -q update  && yum -y -q install \
	epel-release \
	centos-release-scl \	
&& yum -y -q clean all

# Install compile script dependencies
RUN yum -y -q update  && yum -y -q install \
	git \
	wget \
	make \
	automake \
	cmake \
	cmake3 \
	gcc \
	gcc-c++ \
	openssl-devel \
	# Mercury dependencies
	libtool \
	libtool-ltdl-devel \
	libev-devel \
	boost-devel \
	# RocksDB
	which \
	libev-devel \
	snappy-devel \
	gflags-devel \
	libzstd-devel \
	lz4-devel \
	bzip2-devel \
	# ada-fs requires C++ 14
	devtoolset-7-gcc \
	devtoolset-7-gcc-c++ \
&& yum -y -q clean all

# Enable gcc/g++ 7.x
ENV	CC		"/opt/rh/devtoolset-7/root/usr/bin/gcc"
ENV	CXX		"/opt/rh/devtoolset-7/root/usr/bin/g++" 

# Download dependencies source
COPY ifs/scripts/dl_dep.sh		$SCRIPTS_PATH/
RUN /bin/bash $SCRIPTS_PATH/dl_dep.sh $DEPS_SRC_PATH all

# Compile dependencies
COPY ifs/scripts/compile_dep.sh $SCRIPTS_PATH/
COPY ifs/scripts/patches		$SCRIPTS_PATH/patches
RUN /bin/bash $SCRIPTS_PATH/compile_dep.sh $DEPS_SRC_PATH $INSTALL_PATH


FROM centos:7

ENV ADAFS_PATH	/opt/adafs
ENV INSTALL_PATH	${ADAFS_PATH}/build


# Enable epel and scl repository
RUN yum -y -q update  && yum -y -q install \
	epel-release \
	centos-release-scl \	
&& yum -y -q clean all

# Install compile script dependencies
RUN yum -y -q update  && yum -y -q install \
	git \
	wget \
	make \
	automake \
	cmake \
	cmake3 \
	gcc \
	gcc-c++ \
	openssl-devel \
	# Mercury dependencies
	libtool \
	libtool-ltdl-devel \
	libev-devel \
	boost-devel \
	# RocksDB
	which \
	libev-devel \
	snappy-devel \
	gflags-devel \
	libzstd-devel \
	lz4-devel \
	bzip2-devel \
	# ada-fs requires C++ 14
	devtoolset-7-gcc \
	devtoolset-7-gcc-c++ \
&& yum -y -q clean all


# Enable gcc/g++ 7.x
ENV	CC		"/opt/rh/devtoolset-7/root/usr/bin/gcc"
ENV	CXX		"/opt/rh/devtoolset-7/root/usr/bin/g++" 


COPY --from=builder ${INSTALL_PATH} ${INSTALL_PATH}