forked from BlueBrain/spack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (38 loc) · 1.48 KB
/
Dockerfile
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
FROM ubuntu:18.04
MAINTAINER Pramod Kumbhar <pramod.s.kumbhar@gmail.com>
MAINTAINER Matthias Wolf <matthias.wolf@epfl.ch>
ENV DEBIAN_FRONTEND noninteractive
# default software required
RUN apt-get update
RUN apt-get -y install software-properties-common
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update
COPY sysconfig/ubuntu-18.04/packages /tmp/
RUN sed -e 's/#.*//g' /tmp/packages| \
xargs -r apt-get --allow-downgrades \
--allow-remove-essential \
--allow-change-held-packages \
install -y
RUN git clone https://github.com/BlueBrain/spack.git /opt/spack
ENV SPACK_ROOT /opt/spack
ENV PATH $SPACK_ROOT/bin:$PATH
# see this: http://stackoverflow.com/questions/20635472/using-the-run-instruction-in-a-dockerfile-with-source-does-not-work
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN echo ". $SPACK_ROOT/share/spack/setup-env.sh" \
> /etc/profile.d/spack.sh
RUN spack compiler find && spack compilers
RUN mkdir -p $SPACK_ROOT/etc/spack
COPY sysconfig/ubuntu-18.04/*.yaml $SPACK_ROOT/etc/spack/
WORKDIR "/opt/spack"
ARG pr
ARG revision=develop
RUN if [[ "x$pr" != "x" ]]; then \
git fetch origin +refs/pull/$pr/head:refs/remotes/origin/pull/$pr \
&& git checkout pull/$pr; \
elif [[ "x$revision" = "xdevelop" ]]; then \
git checkout $revision \
&& git pull --ff-only; \
else \
git fetch \
&& git checkout $revision; \
fi