forked from SKA-INAF/radio-tiramisu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_old
70 lines (49 loc) · 2.6 KB
/
Dockerfile_old
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
69
70
FROM ubuntu:16.04
######################################
## DEFINE CUSTOMIZABLE ARGS/ENVS
######################################
ARG USER_ARG="caesar"
ENV USER $USER_ARG
ENV PYTHONPATH_BASE ${PYTHONPATH}
##########################################################
## INSTALL SYS LIBS (IF NOT PRESENT IN BASE IMAGE
##########################################################
# - Install OS packages
RUN apt-get update && apt-get install -y software-properties-common apt-utils curl binutils libtool pkg-config build-essential autoconf automake debconf-utils software-properties-common dpkg-dev git cmake wget bzip2 nano unzip locate less ca-certificates iputils-ping nmap dnsutils
# - Reinstall
RUN apt-get install --reinstall python3-pkg-resources
# - Install python3.6
RUN unset PYTHONPATH && add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get install -y python3.6 python3.6-dev
# - Install pip3.6
RUN unset PYTHONPATH && curl https://bootstrap.pypa.io/get-pip.py | python3.6
# - Make python3.6 as the default
RUN rm /usr/bin/python3 && ln -s /usr/bin/python3.6 /usr/bin/python3
# - Install packages
RUN apt-get update && apt-get --no-install-recommends install -y libcurl3 openssl libssl-dev uuid-dev libcap-dev libpcre3-dev util-linux openssh-client openssh-server libsm6 libxext6 ffmpeg libfontconfig1 libxrender1 libgl1-mesa-glx
# - Install git-lsf (needed otherwise large hdf5 data in repo are given a wrong signature and failed to be read)
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && apt-get update && apt-get install git-lfs
##########################################################
## CREATE USER
##########################################################
# - Create user & set permissions
RUN adduser --disabled-password --gecos "" $USER && \
mkdir -p /home/$USER && \
chown -R $USER:$USER /home/$USER
######################################
## INSTALL TIRAMISU
######################################
ENV TIRAMISU_TOP_DIR /opt/Software/Tiramisu
ENV TIRAMISU_DIR $TIRAMISU_TOP_DIR/install
WORKDIR $TIRAMISU_TOP_DIR
# Make sure the environment is activated:
RUN echo "Make sure flask is installed:"
RUN python -c "import flask"
# The code to run when container is started:
COPY ./inference.py .
RUN pip install -r requirements.txt
ENTRYPOINT ["python", "./inference.py"]
# - Clone tiramisu
RUN mkdir -p $TIRAMISU_TOP_DIR $TIRAMISU_DIR $TIRAMISU_DIR/share $TIRAMISU_DIR/lib/python3.6/site-packages
RUN cd $TIRAMISU_TOP_DIR && git clone https://github.com/SKA-INAF/Tiramisu.git