-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile_dev
54 lines (47 loc) · 1.67 KB
/
Dockerfile_dev
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
#
# Dockerfile for pfioh development.
#
# Build with
#
# docker build -t <name>:<tag> -f <dockerfile> .
#
# For example if building a local version, you could do:
#
# docker build -t local/pfioh:dev -f Dockerfile_dev .
#
# 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:dev -f Dockerfile_dev .
#
# To run an interactive shell inside this container, do:
#
# docker run -ti --entrypoint /bin/bash local/pfioh:dev
#
# 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:dev
#
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 DEBIAN_FRONTEND=noninteractive APPROOT="/home/localuser/pfioh"
RUN apt-get update \
&& apt-get install 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 \
&& useradd -u $UID -ms /bin/bash localuser \
&& echo "localuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Copy source code and make localuser the owner
COPY --chown=localuser ./bin ${APPROOT}/bin
COPY --chown=localuser ./pfioh ${APPROOT}/pfioh
COPY --chown=localuser ./openshift ${APPROOT}/openshift
COPY --chown=localuser ./setup.cfg ./setup.py README.rst ${APPROOT}/
RUN pip3 install -e ${APPROOT}
# Start as user localuser
#USER localuser
WORKDIR "/home/localuser"
ENTRYPOINT ["pfioh"]
EXPOSE 5055