Skip to content

Commit 524cd49

Browse files
committed
Added README SL6 dockerfile and hooks
1 parent 072b799 commit 524cd49

File tree

3 files changed

+77
-2
lines changed

3 files changed

+77
-2
lines changed

Dockerfile

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
FROM cern/slc6-base
2+
MAINTAINER UKAEA <[email protected]>
3+
4+
# Build-time metadata as defined at http://label-schema.org
5+
ARG PROJECT_NAME
6+
ARG BUILD_DATE
7+
ARG VCS_REF
8+
ARG VERSION
9+
LABEL org.label-schema.build-date=$BUILD_DATE \
10+
org.label-schema.name="$PROJECT_NAME" \
11+
org.label-schema.description="Scientific Linux docker image for FISPACT-II" \
12+
org.label-schema.url="http://fispact.ukaea.uk/" \
13+
org.label-schema.vcs-ref=$VCS_REF \
14+
org.label-schema.vcs-url="https://github.com/fispact/docker_scientificlinux" \
15+
org.label-schema.vendor="UKAEA" \
16+
org.label-schema.version=$VERSION \
17+
org.label-schema.license="Apache-2.0" \
18+
org.label-schema.schema-version="1.0"
19+
20+
ENV RUN_SCRIPT ~/.bashrc
21+
22+
WORKDIR /
23+
24+
# Install additional packages
25+
RUN yum -y update && \
26+
yum install -y wget which make cmake gmake less doxygen rsync nano tar texi2html texinfo xz && \
27+
yum install -y libgcc gcc-c++ && \
28+
yum install -y gmp-devel mpfr-devel libmpc-devel openssl-devel && \
29+
yum install -y python-devel autoconf automake zlib-devel libpng-devel libjpeg-devel bzip2 zip && \
30+
yum install -y gsl-devel lapack-devel freetype-devel && \
31+
yum -y install yum-utils && \
32+
yum -y groupinstall development && \
33+
yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel && \
34+
yum install -y readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel expat-devel && \
35+
# we must compile gcc ourselves since we can only get gcc-4 from yum
36+
wget https://ftp.gnu.org/gnu/gcc/gcc-6.2.0/gcc-6.2.0.tar.gz && \
37+
tar -xzf gcc-6.2.0.tar.gz && \
38+
mkdir gcc-6.2.0-build && cd gcc-6.2.0-build && \
39+
../gcc-6.2.0/configure --enable-languages=c,c++,fortran --disable-multilib && \
40+
export NCPUS=$(getconf _NPROCESSORS_ONLN) && \
41+
make -j${NCPUS} && \
42+
make install && \
43+
mv /usr/bin/g++ /usr/bin/g++-4 && \
44+
mv /usr/bin/gcc /usr/bin/gcc-4 && \
45+
mv /usr/bin/gfortran /usr/bin/gfortran-4 && \
46+
ln -sf /usr/local/bin/g++-6.2.0 /usr/bin/g++ && \
47+
ln -sf /usr/local/bin/gcc-6.2.0 /usr/bin/gcc && \
48+
ln -sf /usr/local/bin/gfortran-6.2.0 /usr/bin/gfortran && \
49+
cp /usr/local/lib64/libgfortran.* /usr/lib64/ && \
50+
cp /usr/local/lib64/libquadmath.* /usr/lib64/ && \
51+
cd / && \
52+
wget http://python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz && \
53+
tar xf Python-3.6.3.tar.xz && cd Python-3.6.3 && \
54+
./configure --prefix=/usr/local --with-ensurepip=install --enable-optimizations --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib" && \
55+
make -j${NCPUS} && \
56+
make altinstall && \
57+
make install && \
58+
ln -sf /usr/local/bin/pip3.6 /usr/local/bin/pip && \
59+
# pip3 packages
60+
pip install --upgrade pip && \
61+
pip install pytest pytest-xdist pypact numpy && \
62+
# clean up
63+
cd / && rm -rf gcc-6.2.0.tar.gz gcc-6.2.0-build Python-3.6.3.tar.xz Python-3.6.3
64+
65+
CMD /bin/bash $RUN_SCRIPT

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
# docker_scientificlinux
2-
Automated build of Scientific Linux images with the required dependencies for FISPACT-II
1+
# Scientific Linux Docker Container for FISPACT-II
2+
3+
Automated build of Scientific Linux images with the required dependencies for [FISPACT-II](http://fispact.ukaea.uk).
4+
5+
Available on the Docker Hub as [fispact/scientificlinux](https://hub.docker.com/r/fispact/scientificlinux/).

hooks/build

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env sh
2+
docker build \
3+
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
4+
--build-arg VCS_REF=$GIT_SHA1 \
5+
--build-arg VERSION=$DOCKER_TAG \
6+
--build-arg PROJECT_NAME=${DOCKER_REPO#*/*} \
7+
-t $IMAGE_NAME .

0 commit comments

Comments
 (0)