forked from cyrillefavreau/Sol-R
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (43 loc) · 1.61 KB
/
Dockerfile
File metadata and controls
49 lines (43 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Docker container for running Sol-R viewer
FROM ubuntu:xenial
ENV DIST_PATH /app/dist
ENV BUILD_TOOLS build-essential cmake git wget freeglut3-dev
# Set working dir and copy Sol-R assets
ENV SOLR_SRC /app/solr
WORKDIR /app
ADD . ${SOLR_SRC}
# CUDA 8
ENV PATH=/usr/local/cuda/bin:$PATH \
LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
# Install Sol-R
# https://github.com/favreau/Sol-R
RUN apt-get update && \
apt-get -y install ${BUILD_TOOLS} && \
mkdir ${SOLR_SRC}/tmp && \
cd ${SOLR_SRC}/tmp && \
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run && \
chmod +x cuda_*_linux-run && ${SOLR_SRC}/tmp/cuda_*_linux-run -extract=${SOLR_SRC}/tmp && \
${SOLR_SRC}/tmp/cuda-linux64-rel*.run -noprompt | cat > /dev/null && \
cd ${SOLR_SRC} && \
rm -rf tmp && \
mkdir build && \
cd build && \
cmake .. \
-DCMAKE_INSTALL_PREFIX=${DIST_PATH} \
-DCMAKE_BUILD_TYPE=Release \
-DSOLR_ENGINE=CUDA && \
make -j8 install && \
cd /app && \
rm -rf ${SOLR_SRC}/build && \
apt-get -y remove ${BUILD_TOOLS} && \
apt-get clean
# Add binaries from dist to the PATH
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:${DIST_PATH}/lib
ENV PATH $PATH:${DIST_PATH}/bin
# When running `docker run -ti --rm sol-r`,
# this will be the cmd that will be executed (+ the CLI options from CMD).
# To ssh into the container (or override the default entry) use:
# `docker run -ti --rm --entrypoint bash sol-r`
# See https://docs.docker.com/engine/reference/run/#entrypoint-default-command-to-execute-at-runtime
# for more docs
ENTRYPOINT ["solrViewer"]