-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a contrib Dockerfile for local build image on Linux (#4608)
* Add a contrib Dockerfile for local build image on Linux This is necessary as permissions are all incorrect on the paths that are shared between the host system and the Docker build container. Closes #2692 * Use always latest image to build the Docker image * Make image label configurable in docker build script This re-reverts back to using label for some of the dockerfile. Also, instead of creating a group, we simply groupmod the existing docs group. This doesn't address the configuration changes necessary for development images yet. * Update command call for docker_build.sh * Add configuration option that patches the docker image names in development This setting can be used from local_settings.py, and signifies that you have run ``docker_build.sh`` to build local development images that replace the UID/GID.
- Loading branch information
Showing
5 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
ARG label | ||
|
||
FROM readthedocs/build:${label} | ||
|
||
ARG uid | ||
ARG gid | ||
|
||
ENV UID ${uid} | ||
ENV GID ${gid} | ||
|
||
USER root | ||
RUN groupmod --gid ${GID} docs | ||
RUN usermod --uid ${UID} --gid ${GID} docs | ||
USER docs | ||
|
||
CMD ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
uid=`id -u` | ||
gid=`id -g` | ||
basedir=`dirname "$0"` | ||
dockerfile=${basedir}/Dockerfile | ||
|
||
version=$1 | ||
[ -n "${version}" ] || version="latest" | ||
|
||
docker build \ | ||
--no-cache \ | ||
-t readthedocs/build-dev:${version} \ | ||
--build-arg uid=${uid} \ | ||
--build-arg gid=${gid} \ | ||
--build-arg label=${version} \ | ||
- <${dockerfile} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters