Skip to content

Commit b063eb4

Browse files
committed
Move mountpoint to /root/src. Minor other tweaks.
- Legacy-Id: 19129
1 parent 69e4dd8 commit b063eb4

4 files changed

Lines changed: 33 additions & 34 deletions

File tree

docker/Dockerfile

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
# This file is a docker (https://www.docker.com/what-docker) recipe, which can
2-
# be used to build a docker image which is ready to run a datatracker in
3-
# development mode.
1+
# This file is a Docker (https://www.docker.com/why-docker) recipe, which can
2+
# be used to run a datatracker in development mode.
43
#
5-
# It is used to build an image (once you've installed docker) using a command
6-
# like this (assuming suitable replacement of $variables):
7-
#
8-
# $ docker build -t ietf/datatracker:latest .
4+
# The "build" script in this directory can be used to build a Docker image for
5+
# the current branch locally.
96
#
107
# To use a pre-built image, assuming we have a checked-out datatracker
11-
# repository at /home/me/src/6.8.1.dev0, you would start (again assuming you've
12-
# installed docker) a container from an image, as follows:
8+
# repository at /datatracker/6.8.1.dev0, you would start a container from an
9+
# image, as follows:
1310
#
14-
# $ docker run -ti -v /home/me/src/6.8.1.dev0:/root ietf/datatracker:latest
11+
# $ docker run -ti -v /datatracker/6.8.1.dev0:/root/src ietf/datatracker:latest
1512

1613
FROM ubuntu:latest
1714
LABEL maintainer="IETF Tools Team <tools-discuss@ietf.org>"
1815

1916
# Default django runserver port
2017
EXPOSE 8000
2118

22-
# Fetch apt package information, and upgrade to latest package versions
19+
# Install all dependencies that are available as packages
2320
ENV DEBIAN_FRONTEND=noninteractive
24-
RUN apt-get update && apt-get -qy dist-upgrade
25-
26-
# Install the packages we need
27-
RUN apt-get install -qy \
21+
RUN apt-get -y update && \
22+
apt-get -y dist-upgrade && \
23+
apt-get -y install -y \
2824
apache2-utils \
29-
chromium-chromedriver \
25+
curl \
3026
enscript \
3127
ghostscript \
28+
git \
3229
graphviz \
3330
libmariadbclient-dev \
3431
mariadb-server \
32+
npm \
3533
python-is-python3 \
3634
python3-pip \
37-
yang-tools
35+
yang-tools && \
36+
apt-get -y clean
3837

39-
# Get rid of installation files we don't need in the image, to reduce size
40-
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
38+
# Install bower
39+
RUN npm install -g bower
4140

42-
# idnits and dependencies
41+
# Install idnits
4342
ADD https://tools.ietf.org/tools/idnits/idnits /usr/local/bin/
4443
RUN chmod +rx /usr/local/bin/idnits
4544

46-
# Install current datatracker dependencies
47-
WORKDIR /root
48-
COPY requirements.txt .
49-
RUN pip install -r requirements.txt
45+
# Install current datatracker python dependencies
46+
COPY requirements.txt /
47+
RUN pip install -r /requirements.txt
5048

5149
COPY docker-init.sh /docker-init.sh
5250
RUN chmod +x /docker-init.sh
51+
52+
WORKDIR /root/src
5353
ENTRYPOINT ["/docker-init.sh"]

docker/build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ if [ "$(uname)" == "Linux" ]; then
117117
die "Didn't expect to run this script on Linux -- are you inside docker?"
118118
fi
119119

120-
docker rmi -f $REPO:trunk || true
121-
docker build -t $REPO:$TAG docker/
120+
docker rmi -f $REPO:latest || true
121+
docker build --progress=plain --pull --tag $REPO:$TAG docker/
122122
docker tag $(docker images -q $REPO | head -n 1) $REPO:latest
123123
if [ -z "$LOCAL" ]; then
124124
docker push $REPO:latest

docker/docker-init.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if [ ! -d "$MYSQLDIR/ietf_utf8" ]; then
2828
fi
2929

3030
echo "Setting up a default settings_local.py ..."
31-
cp docker/settings_local.py "$HOME/ietf/settings_local.py"
31+
cp docker/settings_local.py "/root/src/ietf/settings_local.py"
3232

3333
for sub in \
3434
test/id \
@@ -57,20 +57,20 @@ for sub in \
5757
data/developers/www6/iesg \
5858
data/developers/www6/iesg/evaluation \
5959
; do
60-
dir="$HOME/$sub"
60+
dir="/root/src/$sub"
6161
if [ ! -d "$dir" ]; then
6262
echo "Creating dir $dir"
6363
mkdir -p "$dir";
6464
chown "$USER" "$dir"
6565
fi
6666
done
6767

68-
if [ ! -f "$HOME/test/data/draft-aliases" ]; then
68+
if [ ! -f "/root/src/test/data/draft-aliases" ]; then
6969
echo "Generating draft aliases ..."
7070
ietf/bin/generate-draft-aliases
7171
fi
7272

73-
if [ ! -f "$HOME/test/data/group-aliases" ]; then
73+
if [ ! -f "/root/src/test/data/group-aliases" ]; then
7474
echo "Generating group aliases ..."
7575
ietf/bin/generate-wg-aliases
7676
fi

docker/run

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ SYNOPSIS
2121
DESCRIPTION
2222
2323
This is a wrapper which runs docker with suitable arguments on a
24-
debian-based docker image which has been set up with the dependencies
24+
docker image which has been set up with the dependencies
2525
needed to easily run the IETF datatracker in development mode. By
2626
default, it expects to find the MySQL database files at
2727
$parent/data/mysql, which is mapped inside the
28-
container to /var/lib/mysql, and it will set up a home directory for
29-
the current user ($USER) and map it to $HOME.
28+
container to /var/lib/mysql.
3029
3130
EOF
3231
echo -e "OPTIONS"
@@ -109,5 +108,5 @@ echo -e "\nThe web interface for 'runserver' should appear on 127.0.0.1:$PORT\n"
109108

110109
docker run -ti -p "$PORT:8000" \
111110
-v "$MYSQLDIR:/var/lib/mysql:cached" \
112-
-v "$parent:/root:cached" \
111+
-v "$parent:/root/src:cached" \
113112
"$REPO:$TAG" "$@"

0 commit comments

Comments
 (0)