Dockerfile 4.01 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

ARG BUILD_THREADS=5

# Set up basic environment
David Blyth's avatar
David Blyth committed
9 10
RUN pacman-key --refresh

David Blyth's avatar
David Blyth committed
11
RUN pacman -S --noconfirm \
12 13
        sed \
        sudo \
David Blyth's avatar
David Blyth committed
14 15
&&  rm -rf /var/cache/pacman/pkg

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

19 20
USER eicuser
WORKDIR /home/eicuser
David Blyth's avatar
David Blyth committed
21 22 23 24

CMD /bin/bash

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

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

48
RUN git clone http://root.cern.ch/git/root.git \
David Blyth's avatar
David Blyth committed
49
&&  cd root \
David Blyth's avatar
David Blyth committed
50
&&  git checkout -q tags/$ROOT_RELEASE \
David Blyth's avatar
David Blyth committed
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
&&  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 \
72
    ROOTSYS=/usr/local
David Blyth's avatar
David Blyth committed
73 74 75

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

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

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

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

RUN sudo pacman -S --noconfirm \
        go \
100 101
&&  sudo rm -rf /var/cache/pacman/pkg

David Blyth's avatar
David Blyth committed
102 103 104 105 106
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 \
107
&&  cd go-proio \
David Blyth's avatar
David Blyth committed
108
&&  git checkout -q $GO_PROIO_CHECKOUT \
109
&&  go get ./... \
David Blyth's avatar
David Blyth committed
110 111
&&  cd \
&&  sudo rm -rf $GOPATH/src $GOPATH/pkg
112 113

# py-proio
David Blyth's avatar
David Blyth committed
114
ENV PY_PROIO_VERSION=0.12.143
115 116

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

121 122 123 124
RUN sudo pip install proio==$PY_PROIO_VERSION \
&&  sudo pip2 install proio==$PY_PROIO_VERSION

# cpp-proio
David Blyth's avatar
David Blyth committed
125
ENV CPP_PROIO_CHECKOUT=v0.10.6
126 127

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

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

David Blyth's avatar
David Blyth committed
148
ENV TENSORFLOW_FOR_EIC_CHECKOUT=4beb115fe1bb2a8c558e85aedba3e51a9175f793
David Blyth's avatar
David Blyth committed
149 150 151 152 153 154 155

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 \
156
&&  bazel build --logging 0 //tensorflow/tools/pip_package:build_pip_package \
David Blyth's avatar
David Blyth committed
157 158
&&  rm -rf pkg \
&&  ./bazel-bin/tensorflow/tools/pip_package/build_pip_package pkg \
159
&&  sudo pip install pkg/*.whl \
David Blyth's avatar
David Blyth committed
160 161 162
&&  cd ../ \
&&  rm -rf tensorflow-for-eic .cache

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

181 182
# Image ingredients
ADD . /image/eic-base