File tree 4 files changed +66
-1
lines changed
4 files changed +66
-1
lines changed Original file line number Diff line number Diff line change
1
+ FROM readthedocs/build:4.0rc1
2
+
3
+ ARG username
4
+ ARG uid=1000
5
+ ARG gid=$uid
6
+ ARG label=latest
7
+
8
+ ENV USERNAME ${username}
9
+ ENV UID ${uid}
10
+ ENV GID ${gid}
11
+
12
+ USER root
13
+ RUN groupadd --gid $GID $USERNAME
14
+ RUN useradd -m --uid $UID --gid $GID $USERNAME
15
+ USER $username
16
+
17
+ CMD ["/bin/bash" ]
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ username=` id -nu`
4
+ uid=` id -u`
5
+ gid=` id -g`
6
+
7
+ version=$1
8
+ [ -n " ${version} " ] || version=" latest"
9
+
10
+ docker build \
11
+ -t readthedocs/build:dev \
12
+ --build-arg username=${username} \
13
+ --build-arg uid=${uid} \
14
+ --build-arg gid=${gid} \
15
+ --build-arg label=${version} \
16
+ .
Original file line number Diff line number Diff line change
1
+ Contrib
2
+ =======
3
+
4
+ Building development Docker image
5
+ ---------------------------------
6
+
7
+ If you run Linux, you likely need to build a local Docker image that extends our
8
+ default image::
9
+
10
+ cd contrib/
11
+ ./docker_build.sh
12
+
1
13
Running Read the Docs via Supervisord
2
- =====================================
14
+ -------------------------------------
3
15
4
16
This is the easiest way to start all of the commands you'll need for development
5
17
in an environment relatively close to the production evironment. All you need is
Original file line number Diff line number Diff line change @@ -82,3 +82,23 @@ DOCKER_VERSION
82
82
Version of the API to use for the Docker API client.
83
83
84
84
Default: :djangosetting: `DOCKER_VERSION `
85
+
86
+ Local development
87
+ -----------------
88
+
89
+ On Linux development environments, it's likely that your UID and GID do not
90
+ match the ``docs `` user that is set up as the default user for builds. In this
91
+ case, it's necessary to make a new image that overrides this user::
92
+
93
+ cd contrib/
94
+ ./docker_build.sh
95
+
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::
103
+
104
+ DOCKER_IMAGE = 'readthedocs/build:dev'
You can’t perform that action at this time.
0 commit comments