-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
35 lines (26 loc) · 1.11 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
FROM phusion/baseimage:0.9.17
MAINTAINER Tim Zenderman <[email protected]>
RUN rm /bin/sh && ln -s /bin/bash /bin/sh && \
sed -i 's/^mesg n$/tty -s \&\& mesg n/g' /root/.profile
WORKDIR /code
ENV PYENV_ROOT /root/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
# Install base system libraries.
ENV DEBIAN_FRONTEND=noninteractive
COPY base_dependencies.txt /code/base_dependencies.txt
RUN apt-get update && \
apt-get install -y $(cat /code/base_dependencies.txt) && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /etc/dpkg/dpkg.cfg.d/02apt-speedup
# Install pyenv and default python version.
ENV PYTHONDONTWRITEBYTECODE true
COPY .python-version /code/.python-version
RUN git clone https://github.com/yyuu/pyenv.git /root/.pyenv && \
cd /root/.pyenv && \
git checkout `git describe --abbrev=0 --tags`
RUN pyenv install && \
pyenv global $(cat .python-version)
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]