Skip to content

Commit 2dc9706

Browse files
authored
Allow to add additional binds to Docker build container (#7684)
* Allow to add additional binds to Docker build container Sometimes it might be necessary to add additional binds to the build container, e.g. to add SSH keys for the docs user to clone private repositories or for caches. These additional binds can be specified as field in settings: RTD_DOCKER_ADDITIONAL_BINDS = { '/home/docs/.ssh': { 'bind': '/home/docs/.ssh', 'mode': 'ro', } }
1 parent 1bf51bd commit 2dc9706

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

readthedocs/doc_builder/environments.py

+2
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,8 @@ def _get_binds(self):
991991
},
992992
}
993993

994+
binds.update(settings.RTD_DOCKER_ADDITIONAL_BINDS)
995+
994996
return binds
995997

996998
def get_container_host_config(self):

readthedocs/settings/base.py

+2
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,8 @@ def TEMPLATES(self):
497497
'readthedocs/build:latest': DOCKER_IMAGE_SETTINGS.get('readthedocs/build:6.0'),
498498
'readthedocs/build:testing': DOCKER_IMAGE_SETTINGS.get('readthedocs/build:7.0'),
499499
})
500+
# Additional binds for the build container
501+
RTD_DOCKER_ADDITIONAL_BINDS = {}
500502

501503
def _get_docker_memory_limit(self):
502504
try:

0 commit comments

Comments
 (0)