/ Dockerfile-dev
Dockerfile-dev
 1  # This Dockerfile builds an image for development.
 2  FROM ubuntu:trusty
 3  MAINTAINER Jakub Warmuz <jakub@warmuz.org>
 4  MAINTAINER William Budington <bill@eff.org>
 5  MAINTAINER Yan <yan@eff.org>
 6  
 7  # Note: this only exposes the port to other docker containers. You
 8  # still have to bind to 443@host at runtime, as per the ACME spec.
 9  EXPOSE 443
10  
11  # TODO: make sure --config-dir and --work-dir cannot be changed
12  # through the CLI (letsencrypt-docker wrapper that uses standalone
13  # authenticator and text mode only?)
14  VOLUME /etc/letsencrypt /var/lib/letsencrypt
15  
16  WORKDIR /opt/letsencrypt
17  
18  # no need to mkdir anything:
19  # https://docs.docker.com/reference/builder/#copy
20  # If <dest> doesn't exist, it is created along with all missing
21  # directories in its path.
22  
23  # TODO: Install non-default Python versions for tox.
24  # TODO: Install Apache/Nginx for plugin development.
25  COPY bootstrap/ubuntu.sh /opt/letsencrypt/src/
26  RUN /opt/letsencrypt/src/ubuntu.sh && \
27      apt-get clean && \
28      rm -rf /var/lib/apt/lists/* \
29             /tmp/* \
30             /var/tmp/*
31  
32  # the above is not likely to change, so by putting it further up the
33  # Dockerfile we make sure we cache as much as possible
34  
35  COPY setup.py README.rst CHANGES.rst MANIFEST.in requirements.txt DISCLAIMER linter_plugin.py tox.cover.sh tox.ini pep8.travis.sh .pep8 .pylintrc /opt/letsencrypt/src/
36  
37  # all above files are necessary for setup.py, however, package source
38  # code directory has to be copied separately to a subdirectory...
39  # https://docs.docker.com/reference/builder/#copy: "If <src> is a
40  # directory, the entire contents of the directory are copied,
41  # including filesystem metadata. Note: The directory itself is not
42  # copied, just its contents." Order again matters, three files are far
43  # more likely to be cached than the whole project directory
44  
45  COPY letsencrypt /opt/letsencrypt/src/letsencrypt/
46  COPY acme /opt/letsencrypt/src/acme/
47  COPY letsencrypt-apache /opt/letsencrypt/src/letsencrypt-apache/
48  COPY letsencrypt-nginx /opt/letsencrypt/src/letsencrypt-nginx/
49  COPY letshelp-letsencrypt /opt/letsencrypt/src/letshelp-letsencrypt/
50  COPY letsencrypt-compatibility-test /opt/letsencrypt/src/letsencrypt-compatibility-test/
51  COPY tests /opt/letsencrypt/src/tests/
52  
53  RUN virtualenv --no-site-packages -p python2 /opt/letsencrypt/venv && \
54      /opt/letsencrypt/venv/bin/pip install \
55      -r /opt/letsencrypt/src/requirements.txt \
56      -e /opt/letsencrypt/src/acme \
57      -e /opt/letsencrypt/src \
58      -e /opt/letsencrypt/src/letsencrypt-apache \
59      -e /opt/letsencrypt/src/letsencrypt-nginx \
60      -e /opt/letsencrypt/src/letshelp-letsencrypt \
61      -e /opt/letsencrypt/src/letsencrypt-compatibility-test \
62      -e /opt/letsencrypt/src[dev,docs,testing]
63  
64  # install in editable mode (-e) to save space: it's not possible to
65  # "rm -rf /opt/letsencrypt/src" (it's stays in the underlaying image);
66  # this might also help in debugging: you can "docker run --entrypoint
67  # bash" and investigate, apply patches, etc.
68  
69  ENV PATH /opt/letsencrypt/venv/bin:$PATH