-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile-debian
49 lines (41 loc) · 1.29 KB
/
Dockerfile-debian
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
# Container holding a reproman development environment.
#
# To build:
# docker build -t reproman:debian \
# -f Dockerfile-debian \
# --build-arg IMAGE=debian:jessie \
# --build-arg UNAME=$USER \
# --build-arg UID=$(id -u) \
# --build-arg GID=$(id -g) \
# .
#
# or docker-compose build debian(be sure to update IMAGE, UID, and GID in docker-compose.yml)
#
# To run:
# docker run -it --name reproman-debian \
# -v $PWD:/home/$USER/reproman \
# -v /var/run/docker.sock:/var/run/docker.sock \
# reproman:debian
#
# or docker-compose run debian
ARG IMAGE=ubuntu:xenial
FROM $IMAGE
RUN apt-get update \
&& apt-get install -y build-essential libssl-dev libffi-dev vim wget \
python-dev python-pyparsing python-crypto python-pip \
&& pip install --upgrade pip
# Create a container user account that matches a system user account.
ARG UNAME=reproman
ARG UID=1000
ARG GID=1000
RUN groupadd -g $GID $UNAME \
&& useradd -m -u $UID -g $GID -s /bin/bash $UNAME
COPY . /home/$UNAME/reproman
COPY reproman.cfg /home/$UNAME
RUN chown -R $UID.$GID /home/$UNAME \
&& rm -r '/home/'$UNAME'/reproman/reproman.egg-info' \
&& find '/home/'$UNAME'/reproman' -name "*.pyc" -delete \
&& pip install -e '/home/'$UNAME'/reproman[devel]'
# USER $UID:$GID
WORKDIR /home/$UNAME
ENTRYPOINT ["/bin/bash"]