Skip to content

Mount docs source read-only in Docker build container#3328

Open
Mpdreamz wants to merge 10 commits intomasterfrom
fix/docker-readonly-mount
Open

Mount docs source read-only in Docker build container#3328
Mpdreamz wants to merge 10 commits intomasterfrom
fix/docker-readonly-mount

Conversation

@Mpdreamz
Copy link
Copy Markdown
Member

@Mpdreamz Mpdreamz commented May 3, 2026

Tightens the Docker mount for the docs build source directory to read-only. The build output is written to the built-docs clone inside the container and pushed via SSH — the source tree never needs to be writable. All product-repo mounts already use :ro,cached; this aligns /docs_build with the same policy.

Two follow-up fixes for the test suite, which assumed a writable source mount:

  • Redirects the rubocop cache from .rubocop_cache (relative, under /docs_build) to /tmp/rubocop_cache
  • Adds a writable bind-mount overlay for resources/web/tests/, which parcel writes build artifacts into before jest reads them across a second Docker invocation

@Mpdreamz Mpdreamz requested a review from a team as a code owner May 3, 2026 16:28
@Mpdreamz Mpdreamz requested a review from reakaleek May 3, 2026 16:28
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

A documentation preview will be available soon.

Request a new doc build by commenting
  • Rebuild this PR: run docs-build
  • Rebuild this PR and all Elastic docs: run docs-build rebuild

run docs-build is much faster than run docs-build rebuild. A rebuild should only be needed in rare situations.

If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here.

timto-elastic
timto-elastic previously approved these changes May 3, 2026
cotti
cotti previously approved these changes May 3, 2026
Mpdreamz and others added 7 commits May 3, 2026 18:55
When the Makefile runs `rm -rf tests` before invoking build_docs
--docker-run, the directory no longer exists on the host. Docker
auto-creates missing bind-mount targets as root, causing EACCES for the
non-root container user. Pre-create the directory with makedirs so the
mount is owned by the current user.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
The integration tests write to /docs_build/.repos/target_repo.git in
start_air_gapped. Shadow that path with a writable tmpfs so the test
can create its own repo there without violating the ro source mount.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ild ro

Mounting /docs_build:ro broke the integration tests (writes to .repos,
.cache etc.) and Docker prevents tmpfs mounts inside a ro bind mount.

Instead keep /docs_build writable and shadow only .buildkite/hooks with
an empty tmpfs. Any code running inside the container can write there but
the writes go to an ephemeral tmpfs, never reaching the host -- so the
Buildkite hook-injection attack vector is closed without breaking builds.
@Mpdreamz Mpdreamz enabled auto-merge (squash) May 3, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants