Dockerfile 3.07 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-02-23
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 48 49 50 51 52 53 54 55
&&  cd root \
&&  git checkout tags/$ROOT_RELEASE \
&&  cd .. \
&&  mkdir build \
&&  cd build \
&&  cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DCMAKE_BUILD_TYPE=Release \
        -Dbuiltin_glew=OFF \
56
        -Dbuildtin_llvm=OFF \
David Blyth's avatar
David Blyth committed
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
        -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 \
    ROOTSYS=/usr/local \
72
    MANPATH=/usr/local/man
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 87 88 89 90 91 92

RUN git clone https://github.com/lz4/lz4.git \
&&  cd lz4 \
&&  git checkout tags/$LZ4_RELEASE \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../ \
&&  rm -rf lz4

David Blyth's avatar
David Blyth committed
93
# ProIO
David Blyth's avatar
David Blyth committed
94
ENV GOPATH=/opt/Go
95
ENV PROIO_CHECKOUT=e1ba248cbeb92e0598df272bec1c32d874223b8b \
David Blyth's avatar
David Blyth committed
96 97 98 99 100 101 102 103 104 105
    PROIO_SOURCE=$GOPATH/src/github.com/decibelcooper/proio \
    PATH=$GOPATH/bin:${PATH}

RUN sudo pacman -S --noconfirm \
        go \
        python-pip \
        python2-pip \
&&  sudo rm -rf /var/cache/pacman/pkg

RUN sudo mkdir $GOPATH \
106
&&  sudo chown eicuser:eicuser $GOPATH \
David Blyth's avatar
David Blyth committed
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
&&  git clone https://github.com/decibelcooper/proio.git $PROIO_SOURCE \
&&  cd $PROIO_SOURCE \
&&  git checkout $PROIO_CHECKOUT \
&&  mkdir cpp-proio/build \
&&  cd cpp-proio/build \
&&  cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DCMAKE_BUILD_TYPE=Release \
        ../ \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../../go-proio \
&&  go get ./... \
&&  cd ../py-proio \
&&  sudo pip install . \
&&  sudo pip2 install . \
&&  cd \
&&  rm -rf $GOPATH/src

# Convenience tools
RUN sudo pacman -S --noconfirm \
128
        emacs \
129
        gdb \
130
        mesa-demos \
131 132
        ipython \
        ipython2 \
133 134 135
        man-db \
        man-pages \
        nano \
David Blyth's avatar
David Blyth committed
136 137
        openssh \
        procps-ng \
138
        vi \
David Blyth's avatar
David Blyth committed
139
        vim \
140
        wget \
141
        which \
142
        xorg-server-xvfb \
David Blyth's avatar
David Blyth committed
143 144
&&  sudo rm -rf /var/cache/pacman/pkg

145
ENV MANPATH=""