-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (49 loc) · 1.67 KB
/
Dockerfile
File metadata and controls
68 lines (49 loc) · 1.67 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM ubuntu:22.04
MAINTAINER Heather Kelly <heather@slac.stanford.edu>
ARG DESC_PYTHON_DIR=/opt/desc
RUN apt update -y && \
apt install -y curl \
build-essential \
gfortran \
git \
patch \
wget && \
apt-get clean && \
rm -rf /var/cache/apt && \
groupadd -g 1000 -r lsst && useradd -u 1000 --no-log-init -m -r -g lsst lsst && \
usermod --shell /bin/bash lsst && \
cd /tmp && \
git clone https://github.com/LSSTDESC/desc-python && \
cd desc-python && \
cd conda && \
bash install-mpich.sh && \
cd /tmp && \
chown -R lsst desc-python && \
mkdir -p $DESC_PYTHON_DIR && \
chown lsst $DESC_PYTHON_DIR && \
chgrp lsst $DESC_PYTHON_DIR
ARG LSST_USER=lsst
ARG LSST_GROUP=lsst
WORKDIR $DESC_PYTHON_DIR
USER lsst
ENV PYTHONDONTWRITEBYTECODE 1
RUN cd /tmp/desc-python/conda && \
bash install-desc-python.sh /opt/desc/py conda-pack.txt pip-pack.txt NERSC && \
find /$DESC_PYTHON_DIR -name "*.pyc" -delete && \
(find $DESC_PYTHON_DIR -name "doc" | xargs rm -Rf) || true && \
(find $DESC_PYTHON_DIR -name "*.so" ! -path "*/xpa/*" | xargs strip -s -p) || true && \
cd /tmp && \
rm -Rf desc-python
USER root
RUN ln -s /opt/desc/py /usr/local/py
USER lsst
ENV HDF5_USE_FILE_LOCKING FALSE
ENV PYTHONSTARTUP ''
RUN echo "source /opt/desc/py/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc
ENV PATH="${DESC_PYTHON_DIR}/${PY_VER}/bin:${PATH}"
SHELL ["/bin/bash", "--login", "-c"]
# echo "source /opt/desc/py/etc/profile.d/conda.sh" >> ~/.bashrc && \
# echo "conda activate base" >> ~/.bashrc && \
#ENV PATH="${DESC_PYTHON_DIR}:${PATH}"
#CMD ["/bin/bash"]