Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build tip #2692

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions docs/development/buildenvironments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Build Environments
==================

Read the Docs uses container virtualization to encapsulate documentation build
processes. Each build spins up a new virtual machine using our base image,
processes. Each build spins up a new container using our base image,
which is an image with the minimum necessary components required to build
documentation. Virtual machines are limiting in CPU time and memory, which aims
documentation. Containers are limiting in CPU time and memory, which aims
to reduce excessive usage of build resources.

Setup
Expand Down Expand Up @@ -37,6 +37,39 @@ image -- see `Configuration`_.
.. _`Docker Hub repository`: https://hub.docker.com/r/readthedocs/build/
.. _`container image repo`: https://github.com/rtfd/readthedocs-docker-images

.. Tip::

Since the already built docker image uses the `docs` user with a
specific `user id` and `group id` which probably is different than
the one you are running your `runserver`, you may receive
*Pemission errors*.

As a workaround for this, you could build your own docker image
with the following `Dockerfile`::

# Read the Docs - Environment base
FROM readthedocs/build:2.0

USER root

# UID and GID from readthedocs/user
RUN groupadd --gid 1000 humitos
RUN useradd -m --uid 1000 --gid 1000 humitos

USER humitos

CMD ["/bin/bash"]

Where `1000` and `humitos` should match with your own `group id`,
`user id` and `username` in your system. Then run this command to
build your *modified* image::

docker build -f Dockerfile.user -t readthedocs/build:2.0-modified .

After that you should set your `DOCKER_IMAGE` setting to
`readthedocs/build:2.0-modified`.


Configuration
-------------

Expand Down