Skip to content

Commit

Permalink
Use always latest image to build the Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
humitos committed May 17, 2019
1 parent 240fe78 commit 22b53d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 21 deletions.
12 changes: 5 additions & 7 deletions contrib/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
FROM readthedocs/build:4.0rc1
FROM readthedocs/build:latest

ARG username
ARG uid=1000
ARG uid=$uid
ARG gid=$uid
ARG label=latest

ENV USERNAME ${username}
ENV UID ${uid}
ENV GID ${gid}

USER root
RUN groupadd --gid $GID $USERNAME
RUN useradd -m --uid $UID --gid $GID $USERNAME
USER $username
RUN groupadd --gid ${GID} docscustom
RUN usermod --uid ${UID} --gid ${GID} docs
USER docs

CMD ["/bin/bash"]
7 changes: 1 addition & 6 deletions contrib/docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ username=`id -nu`
uid=`id -u`
gid=`id -g`

version=$1
[ -n "${version}" ] || version="latest"

docker build \
-t readthedocs/build:dev \
--build-arg username=${username} \
-t readthedocs/build:latest-dev \
--build-arg uid=${uid} \
--build-arg gid=${gid} \
--build-arg label=${version} \
.
12 changes: 4 additions & 8 deletions docs/development/buildenvironments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ DOCKER_VERSION

Default: :djangosetting:`DOCKER_VERSION`


Local development
-----------------

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

You can also specify a specific image version to use::

cd contrib/
./docker_build.sh 4.0rc1

This will create a new image, ``readthedocs/build:dev``, which you can specify
as the default image in local settings overrides::
This will create a new image, ``readthedocs/build:latest-dev``,
which you can re-tag as ``latest`` to make Read the Docs use this image instead::

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

0 comments on commit 22b53d0

Please sign in to comment.