forked from FNNDSC/pfioh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (49 loc) · 1.94 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
48
49
50
51
52
53
54
55
#
# Dockerfile for pfioh repository.
#
# Build with
#
# docker build -t <name> .
#
# For example if building a local version, you could do:
#
# docker build -t local/pfioh .
#
# In the case of a proxy (located at say 10.41.13.4:3128), do:
#
# export PROXY="http://10.41.13.4:3128"
# docker build --build-arg http_proxy=${PROXY} --build-arg UID=$UID -t local/pfioh .
#
# To run an interactive shell inside this container, do:
#
# docker run -ti --rm --entrypoint /bin/bash local/pfioh
#
# To pass an env var HOST_IP to container, do:
#
# docker run -ti --rm -e HOST_IP=$(ip route | grep -v docker | awk '{if(NF==11) print $9}') --entrypoint /bin/bash local/pfioh
#
FROM fnndsc/ubuntu-python3:latest
MAINTAINER fnndsc "[email protected]"
# Pass a UID on build command line (see above) to set internal UID
ARG UID=1001
ENV UID=$UID
COPY . /tmp/pfioh
COPY ./docker-entrypoint.py /dock/docker-entrypoint.py
RUN apt-get update \
&& apt-get install sudo \
&& useradd -u $UID -ms /bin/bash localuser \
&& addgroup localuser sudo \
&& echo "localuser:localuser" | chpasswd \
&& adduser localuser sudo \
&& apt-get install -y libssl-dev libcurl4-openssl-dev bsdmainutils vim net-tools inetutils-ping \
&& apt-get install -y libgnutls28-dev \
&& pip install --upgrade pip \
&& pip3 install /tmp/pfioh \
&& rm -rf /tmp/pfioh \
&& chmod 777 /dock \
&& chmod 777 /dock/docker-entrypoint.py \
&& echo "localuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
ENTRYPOINT ["/dock/docker-entrypoint.py"]
EXPOSE 5055
# Start as user $UID
# USER $UID