Skip to content

Commit 22b53d0

Browse files
committed
Use always latest image to build the Docker image
1 parent 240fe78 commit 22b53d0

File tree

3 files changed

+10
-21
lines changed

3 files changed

+10
-21
lines changed

contrib/Dockerfile

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
FROM readthedocs/build:4.0rc1
1+
FROM readthedocs/build:latest
22

33
ARG username
4-
ARG uid=1000
4+
ARG uid=$uid
55
ARG gid=$uid
6-
ARG label=latest
76

8-
ENV USERNAME ${username}
97
ENV UID ${uid}
108
ENV GID ${gid}
119

1210
USER root
13-
RUN groupadd --gid $GID $USERNAME
14-
RUN useradd -m --uid $UID --gid $GID $USERNAME
15-
USER $username
11+
RUN groupadd --gid ${GID} docscustom
12+
RUN usermod --uid ${UID} --gid ${GID} docs
13+
USER docs
1614

1715
CMD ["/bin/bash"]

contrib/docker_build.sh

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@ username=`id -nu`
44
uid=`id -u`
55
gid=`id -g`
66

7-
version=$1
8-
[ -n "${version}" ] || version="latest"
9-
107
docker build \
11-
-t readthedocs/build:dev \
12-
--build-arg username=${username} \
8+
-t readthedocs/build:latest-dev \
139
--build-arg uid=${uid} \
1410
--build-arg gid=${gid} \
15-
--build-arg label=${version} \
1611
.

docs/development/buildenvironments.rst

+4-8
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ DOCKER_VERSION
8383

8484
Default: :djangosetting:`DOCKER_VERSION`
8585

86+
8687
Local development
8788
-----------------
8889

@@ -93,12 +94,7 @@ case, it's necessary to make a new image that overrides this user::
9394
cd contrib/
9495
./docker_build.sh
9596

96-
You can also specify a specific image version to use::
97-
98-
cd contrib/
99-
./docker_build.sh 4.0rc1
100-
101-
This will create a new image, ``readthedocs/build:dev``, which you can specify
102-
as the default image in local settings overrides::
97+
This will create a new image, ``readthedocs/build:latest-dev``,
98+
which you can re-tag as ``latest`` to make Read the Docs use this image instead::
10399

104-
DOCKER_IMAGE = 'readthedocs/build:dev'
100+
docker tag readthedocs/build:latest-dev readthedocs/build:latest

0 commit comments

Comments
 (0)