-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
53 lines (46 loc) · 1.72 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
#
# Dockerfile for pfurl repository.
#
# Build with
#
# docker build -t <name> .
#
# For example if building a local version, you could do:
#
# docker build -t local/pfurl .
#
# 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/pfurl .
#
# To run an interactive shell inside this container, do:
#
# docker run -ti --entrypoint /bin/bash local/pfurl
#
# To pass an env var HOST_IP to container, do:
#
# docker run -ti -e HOST_IP=$(ip route | grep -v docker | awk '{if(NF==11) print $9}') --entrypoint /bin/bash local/pfurl
#
FROM fnndsc/ubuntu-python3:latest
MAINTAINER fnndsc "dev@babymri.org"
# Pass a UID on build command line (see above) to set internal UID
ARG UID=1001
ENV UID=$UID
COPY . /tmp/pfurl
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 \
&& pip install --upgrade pip \
&& pip install /tmp/pfurl && rm -fr /tmp/pfurl
RUN chmod 777 /dock \
&& chmod 777 /dock/docker-entrypoint.py \
&& echo "localuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
ENTRYPOINT ["/dock/docker-entrypoint.py"]
# Start as user $UID
USER $UID