Skip to content

Commit 7accaed

Browse files
committed
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: DOCKER_ADDITIONAL_BINDS = { '/home/docs/.ssh': { 'bind': '/home/docs/.ssh', 'mode': 'ro', } }
1 parent 5234f41 commit 7accaed

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(getattr(settings, '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
@@ -488,6 +488,8 @@ def TEMPLATES(self):
488488
'readthedocs/build:latest': DOCKER_IMAGE_SETTINGS.get('readthedocs/build:6.0'),
489489
'readthedocs/build:testing': DOCKER_IMAGE_SETTINGS.get('readthedocs/build:7.0'),
490490
})
491+
# additional binds for the build container
492+
DOCKER_ADDITIONAL_BINDS = {}
491493

492494
def _get_docker_memory_limit(self):
493495
try:

0 commit comments

Comments
 (0)