Dockerfile 3.98 KB
Newer Older
David Blyth's avatar
David Blyth committed
1 2 3
# Author: David Blyth
# Description: Docker build for producing a base for ANL EIC software efforts

David Blyth's avatar
David Blyth committed
4
FROM dbcooper/arch:2018-06-05
David Blyth's avatar
David Blyth committed
5 6 7 8 9

ARG BUILD_THREADS=5

# Set up basic environment
RUN pacman -S --noconfirm \
10 11
        sed \
        sudo \
David Blyth's avatar
David Blyth committed
12 13
&&  rm -rf /var/cache/pacman/pkg

14
RUN useradd -m -G wheel eicuser \
15
&&  sed -i.bak 's/\s*#\s*\(%wheel\s*ALL=(ALL)\s*NOPASSWD:\s*ALL\)/\1/' /etc/sudoers
David Blyth's avatar
David Blyth committed
16

17 18
USER eicuser
WORKDIR /home/eicuser
David Blyth's avatar
David Blyth committed
19 20 21 22

CMD /bin/bash

# ROOT
23 24 25
ENV ROOT_RELEASE=v6-12-06 \
    CC=/usr/bin/clang \
    CXX=/usr/bin/clang++
26

David Blyth's avatar
David Blyth committed
27 28 29
RUN sudo pacman -S --noconfirm \
        awk \
        binutils \
30
        clang \
David Blyth's avatar
David Blyth committed
31 32
        cmake \
        fftw \
33
        git \
David Blyth's avatar
David Blyth committed
34 35 36 37 38 39 40 41 42 43 44 45
        glew \
        glu \
        grep \
        gsl \
        gzip \
        libx11 \
        libxft \
        libxpm \
        make \
        python2 \
&&  sudo rm -rf /var/cache/pacman/pkg

46
RUN git clone http://root.cern.ch/git/root.git \
David Blyth's avatar
David Blyth committed
47
&&  cd root \
David Blyth's avatar
David Blyth committed
48
&&  git checkout -q tags/$ROOT_RELEASE \
David Blyth's avatar
David Blyth committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
&&  cd .. \
&&  mkdir build \
&&  cd build \
&&  cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DCMAKE_BUILD_TYPE=Release \
        -Dbuiltin_glew=OFF \
        -Dgdml=ON \
        -Dgsl_shared=ON \
        -Dmathmore=ON \
        -Dminuit2=ON \
        -Dopengl=ON \
        ../root \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd .. \
&&  rm -rf build root

ENV PATH=/usr/local/bin:${PATH} \
    LD_LIBRARY_PATH=/usr/local/lib \
    PYTHONPATH=/usr/local/lib \
70
    ROOTSYS=/usr/local
David Blyth's avatar
David Blyth committed
71 72 73

# Protobuf
RUN sudo pacman -S --noconfirm \
74 75 76 77
        protobuf \
        protobuf-c \
        python-protobuf \
        python2-protobuf \
David Blyth's avatar
David Blyth committed
78 79
&&  sudo rm -rf /var/cache/pacman/pkg

80
# lz4
David Blyth's avatar
David Blyth committed
81
ENV LZ4_RELEASE=v1.8.1.2
82 83 84

RUN git clone https://github.com/lz4/lz4.git \
&&  cd lz4 \
David Blyth's avatar
David Blyth committed
85
&&  git checkout -q tags/$LZ4_RELEASE \
86 87 88 89 90
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../ \
&&  rm -rf lz4

91
# go-proio
David Blyth's avatar
David Blyth committed
92
ENV GOPATH=/opt/Go
93
ENV GO_PROIO_CHECKOUT=v0.4.1 \
David Blyth's avatar
David Blyth committed
94 95 96 97
    PATH=$GOPATH/bin:${PATH}

RUN sudo pacman -S --noconfirm \
        go \
98 99
&&  sudo rm -rf /var/cache/pacman/pkg

David Blyth's avatar
David Blyth committed
100 101 102 103 104
RUN sudo mkdir -p $GOPATH \
&&  sudo chmod o+w $GOPATH \
&&  mkdir -p $GOPATH/src/github.com/proio-org \
&&  cd $GOPATH/src/github.com/proio-org \
&&  git clone https://github.com/proio-org/go-proio.git \
105
&&  cd go-proio \
David Blyth's avatar
David Blyth committed
106
&&  git checkout -q $GO_PROIO_CHECKOUT \
107
&&  go get ./... \
David Blyth's avatar
David Blyth committed
108 109
&&  cd \
&&  sudo rm -rf $GOPATH/src $GOPATH/pkg
110 111

# py-proio
112
ENV PY_PROIO_VERSION=0.12.101
113 114

RUN sudo pacman -S --noconfirm \
David Blyth's avatar
David Blyth committed
115 116 117 118
        python-pip \
        python2-pip \
&&  sudo rm -rf /var/cache/pacman/pkg

119 120 121 122
RUN sudo pip install proio==$PY_PROIO_VERSION \
&&  sudo pip2 install proio==$PY_PROIO_VERSION

# cpp-proio
123
ENV CPP_PROIO_CHECKOUT=v0.10.4
124 125

RUN git clone https://github.com/proio-org/cpp-proio.git \
David Blyth's avatar
David Blyth committed
126 127
&&  mkdir cpp-proio/build \
&&  cd cpp-proio/build \
David Blyth's avatar
David Blyth committed
128
&&  git checkout -q $CPP_PROIO_CHECKOUT \
129 130 131
&&  git submodule init \
&&  git submodule update \
&&  cmake ../ \
David Blyth's avatar
David Blyth committed
132 133
&&  make -j $BUILD_THREADS \
&&  sudo make install \
134 135
&&  cd ../../ \
&&  rm -rf cpp-proio
David Blyth's avatar
David Blyth committed
136

David Blyth's avatar
David Blyth committed
137 138 139 140 141 142 143 144 145
# tensorflow-for-eic
RUN sudo pacman -S --noconfirm \
        bazel \
        patch \
        python-numpy \
        python-wheel \
        which \
&&  sudo rm -rf /var/cache/pacman/pkg

146
ENV TENSORFLOW_FOR_EIC_CHECKOUT=cd0e88c189401784e1b32a5ff499a539f403a2a0
David Blyth's avatar
David Blyth committed
147 148 149 150 151 152 153

RUN git clone https://eicweb.phy.anl.gov/EIC/tensorflow-for-eic.git \
&&  cd tensorflow-for-eic \
&&  git checkout -q $TENSORFLOW_FOR_EIC_CHECKOUT \
&&  CC=/usr/bin/gcc \
&&  CXX=/usr/bin/g++ \
&&  ./configure \
154
&&  bazel build --logging 0 //tensorflow/tools/pip_package:build_pip_package \
David Blyth's avatar
David Blyth committed
155 156
&&  rm -rf pkg \
&&  ./bazel-bin/tensorflow/tools/pip_package/build_pip_package pkg \
157
&&  sudo pip install pkg/*.whl \
David Blyth's avatar
David Blyth committed
158 159 160
&&  cd ../ \
&&  rm -rf tensorflow-for-eic .cache

David Blyth's avatar
David Blyth committed
161 162
# Convenience tools
RUN sudo pacman -S --noconfirm \
163
        emacs \
164
        gdb \
165
        mesa-demos \
166 167
        ipython \
        ipython2 \
168 169 170
        man-db \
        man-pages \
        nano \
David Blyth's avatar
David Blyth committed
171 172
        openssh \
        procps-ng \
173
        vi \
David Blyth's avatar
David Blyth committed
174
        vim \
175
        wget \
176
        xorg-server-xvfb \
David Blyth's avatar
David Blyth committed
177 178
&&  sudo rm -rf /var/cache/pacman/pkg

179 180
# Image ingredients
ADD . /image/eic-base