Skip to content

Commit f3bb9ad

Browse files
Mpdreamzclaude
andauthored
Mount docs source read-only in Docker build container (#3328)
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 401b22a commit f3bb9ad

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ require:
55

66
AllCops:
77
TargetRubyVersion: 2.3
8-
CacheRootDirectory: .rubocop_cache
8+
CacheRootDirectory: /tmp/rubocop_cache
99
MaxFilesInCache: 1000
1010

1111
Style/ReturnNil:

build_docs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import errno
1919
import logging
20-
from os import environ, getgid, getuid
20+
from os import environ, getgid, getuid, makedirs
2121
from os.path import basename, dirname, exists, expanduser, isdir
2222
from os.path import join, normpath, realpath
2323
import re
@@ -556,6 +556,9 @@ def standard_docker_args():
556556
docker_args.extend(['--user', '%d:%d' % (uid, getgid())])
557557
# Mount the docs build code so we can run it!
558558
docker_args.extend(['-v', '%s:/docs_build:cached' % DIR])
559+
# Shadow .buildkite/hooks with an empty tmpfs so any code running inside
560+
# the container cannot plant Buildkite hooks that execute on the host.
561+
docker_args.extend(['--tmpfs', '/docs_build/.buildkite/hooks'])
559562
# Seccomp adds a *devestating* performance overhead if you happen
560563
# to have it installed.
561564
docker_args.extend(['--security-opt', 'seccomp=unconfined'])

0 commit comments

Comments
 (0)