Skip to content

Commit d9e2354

Browse files
committed
A first version of a Dockerfile, to build a docker image suitable for hosting a development version of the datatracker. This version runs the test suite successfully, but does not set up the database and does not contain supporting drafts, charters, etc.
- Legacy-Id: 10434
1 parent f336da2 commit d9e2354

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

docker/Dockerfile

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# This file is a docker (https://www.docker.com/what-docker) recipe, which can be used to build
2+
# a docker image which is ready to run a datatracker in development mode.
3+
#
4+
# It is used to build an image (once you've installed docker) using a command like this (assuming
5+
# suitable replacement of $variables:
6+
#
7+
# $ docker build -t $yourdockerid/datatracker:$version
8+
#
9+
# To use a pre-built image, assuming we're on OS X and have a checked-out datatracker repository
10+
# at /Users/$login/src/6.8.1.dev0, you would start (again assuming you've installed docker)
11+
# a container from an image, as follows:
12+
#
13+
# $ docker run -ti --name=$containername -v /Users/$login:/home/$login levkowetz/datatracker:$version /bin/bash
14+
#
15+
# This maps your home directory to /home/$login in the container, and starts it running /bin/bash.
16+
#
17+
# In this first version, the docker environment is set up so that tests will run successfully,
18+
# but the database has *not* been loaded with a dump, and supporting files (drafts, charters, etc.)
19+
# have *not* been downloaded.
20+
21+
FROM debian:wheezy
22+
MAINTAINER Henrik Levkowetz <henrik@levkowetz.com>
23+
24+
# Use backports
25+
RUN echo "deb http://http.debian.net/debian wheezy-backports main contrib non-free" >> /etc/apt/sources.list
26+
27+
# Run apt-get noninteractive
28+
ENV DEBIAN_FRONTEND=noninteractive
29+
30+
# Some basics
31+
RUN apt-get update
32+
RUN apt-get install -qy apt-utils wget less python procps ca-certificates
33+
34+
# MySQL
35+
RUN apt-get install -qy mysql-server
36+
37+
# Subversion
38+
RUN apt-get install -qy subversion/wheezy-backports libsvn1/wheezy-backports
39+
40+
# Some things needed to compile requirements
41+
RUN apt-get install -qy libmysqlclient-dev python-dev libxml2-dev libxslt-dev
42+
43+
# Pip
44+
ENV PYTHONWARNINGS="ignore:a true SSLContext object"
45+
WORKDIR /usr/src
46+
RUN wget -q https://bootstrap.pypa.io/get-pip.py
47+
RUN python get-pip.py
48+
RUN pip --version
49+
RUN pip install virtualenv
50+
51+
# idnits and dependencies
52+
RUN apt-get install -qy gawk
53+
RUN wget -q -P /usr/local/bin/ https://tools.ietf.org/tools/idnits/idnits
54+
RUN chmod +x /usr/local/bin/idnits
55+
56+
# A default user
57+
RUN useradd -ms /bin/bash django
58+
USER django
59+
WORKDIR /home/django
60+
61+
# Check out trunk, in order to verify setup by running tests
62+
RUN mkdir -p ~/src
63+
WORKDIR /home/django/src
64+
RUN svn co https://svn.tools.ietf.org/svn/tools/ietfdb/trunk trunk
65+
66+
# Set up a virtualenv, install requirements, run tests
67+
WORKDIR /home/django/src/trunk
68+
RUN virtualenv .
69+
RUN . bin/activate; pip install -r requirements.txt
70+
COPY settings_local.py ./settings_local.py
71+
RUN . bin/activate; ietf/manage.py test --settings=settings_sqlitetest
72+
73+
WORKDIR /home

0 commit comments

Comments
 (0)