Skip to content

4901 devcontainer does not build when behind an ssl proxy#4982

Draft
ChrisChapman-gh wants to merge 9 commits into
mainfrom
4901-devcontainer-does-not-build-when-behind-an-ssl-proxy
Draft

4901 devcontainer does not build when behind an ssl proxy#4982
ChrisChapman-gh wants to merge 9 commits into
mainfrom
4901-devcontainer-does-not-build-when-behind-an-ssl-proxy

Conversation

@ChrisChapman-gh

@ChrisChapman-gh ChrisChapman-gh commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Resolves #4901

What is being addressed

TRE will not deploy when behind an SSL proxy as they uses internal SSL certificates to sign all requests and the CA is not available to either the devcontainer image or any of the subsequent docker builds.

The devcontainer has also been updated to allow local codex folder to be mounted in the vscode home folder.

How is this addressed

Dev Container

Added a folder where untracked CA files can be dropped, they will be added to the devcontainer's trusted CAs when it is built.

Docker files and porter

The Makefile and devops scripts have been patched so that each Dockerfile/Dockerfile.tmpl is configured to include the CA files from the devcontainers trusted_ca folder.

The patch only kicks in if running inside the devcontainer.

The patch is ephemeral and the Dockerfiles are reverted once finished with. (no long term changes to the Dockerfiles)

The patched CA trust should only persist for the duration of the docker build process and are not used by or present in the final container image.

@ChrisChapman-gh ChrisChapman-gh self-assigned this Jul 17, 2026
@ChrisChapman-gh ChrisChapman-gh added feature dependencies Pull requests that update a dependency file labels Jul 17, 2026
@github-actions

Copy link
Copy Markdown

Unit Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 05bbd41.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses devcontainer usability behind SSL-intercepting proxies by adding a mechanism to trust user-provided root CAs during devcontainer build and during subsequent Docker/Porter builds executed from within the devcontainer. It also updates the devcontainer to mount a local .codex directory into the container.

Changes:

  • Add a /.devcontainer/trusted_ca drop-folder and install any provided CA certs into the devcontainer’s trusted store during devcontainer image build.
  • Ephemerally patch Dockerfiles/Porter Dockerfile templates during builds in the devcontainer to inject the devcontainer-trusted CAs via BuildKit build contexts.
  • Mount ~/.codex into the devcontainer and create the folder on initialization.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Makefile Injects devcontainer CA build-context and Dockerfile patching into image build flow; adds CA patch step before porter publish.
docs/tre-admins/setup-instructions/prerequisites.md Documents how to use /.devcontainer/trusted_ca when behind an SSL proxy.
devops/scripts/porter_devcontainer_ca.sh New helper to patch Porter bundle Dockerfile templates to inject trusted CAs during builds in the devcontainer.
devops/scripts/porter_build_bundle.sh Adds devcontainer CA patching and passes build-context args to porter build.
devops/scripts/docker_devcontainer_ca.sh New helper to patch generic Dockerfiles (multi-stage aware) to inject trusted CAs during devcontainer builds.
devops/scripts/bundle_runtime_image_build.sh Applies Docker devcontainer CA patching and forwards build-context args to docker build.
CHANGELOG.md Adds an enhancement entry for trusted CA support in devcontainer-driven builds.
.devcontainer/trusted_ca/.gitignore Adds an always-present, gitignored folder intended to hold untracked CA cert files.
.devcontainer/scripts/initialize.cmd Ensures ~/.codex exists on Windows hosts.
.devcontainer/scripts/initialize Ensures ~/.codex exists on Linux/macOS hosts.
.devcontainer/Dockerfile Installs any provided trusted CAs into the devcontainer and sets related CA environment variables.
.devcontainer/devcontainer.json Adds .codex mount and forces linux/amd64 platform for build/run.

Comment thread Makefile
Comment on lines +93 to +97
trusted_ca_source="${MAKEFILE_DIR}/.devcontainer/trusted_ca"; \
dockerfile=$(3); \
if [ ! -f "$${dockerfile}" ]; then echo "Unable to find Dockerfile $${dockerfile}" >&2; exit 1; fi; \
if [ ! -d "$${trusted_ca_source}" ]; then echo "Unable to find trusted CA directory $${trusted_ca_source}" >&2; exit 1; fi; \
if ! find "$${trusted_ca_source}" -maxdepth 1 -type f \( -name '*.crt' -o -name '*.pem' -o -name '*.cer' \) -print -quit | grep -q .; then echo "No .crt, .pem, or .cer files found in $${trusted_ca_source}" >&2; exit 1; fi; \
Comment on lines +54 to +57
if ! find "${trusted_ca_source}" -maxdepth 1 -type f \( -name '*.crt' -o -name '*.pem' -o -name '*.cer' \) -print -quit | grep -q .; then
echo "No .crt, .pem, or .cer files found in ${trusted_ca_source}" >&2
return 1
fi
Comment on lines +49 to +52
if ! find "${trusted_ca_source}" -maxdepth 1 -type f \( -name '*.crt' -o -name '*.pem' -o -name '*.cer' \) -print -quit | grep -q .; then
echo "No .crt, .pem, or .cer files found in ${trusted_ca_source}" >&2
return 1
fi
Comment thread CHANGELOG.md
* Update dependencies to address Dependabot security alerts: `aiohttp` to 3.14.1, `Pygments` to 2.20.0, `esbuild`, `ws`, `js-yaml`, `@babel/core`, `flatted` (via vitest upgrade), and `react-router-dom`. ([#4950](https://github.com/microsoft/AzureTRE/issues/4950))
* Added support for formatting UI code via `pre-commit` and fixed existing formatting issues. ([#4955](https://github.com/microsoft/AzureTRE/issues/4955))
* Updated the version of `super-linter` used in the `build_validation_develop` workflow ([#4957](https://github.com/microsoft/AzureTRE/issues/4957))
* Add trusted CA support for devcontainer image builds and Porter bundle build and publish workflows.
Comment on lines +12 to +14
"options": [
"--platform=linux/amd64"
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DevContainer does not build when behind an SSL proxy

2 participants