Skip to content

fix: propagate Docker image ENV vars to runtime sandbox processes#3148

Open
AdaAibaby wants to merge 1 commit into
e2b-dev:mainfrom
AdaAibaby:fix/propagate-docker-env-vars-to-runtime
Open

fix: propagate Docker image ENV vars to runtime sandbox processes#3148
AdaAibaby wants to merge 1 commit into
e2b-dev:mainfrom
AdaAibaby:fix/propagate-docker-env-vars-to-runtime

Conversation

@AdaAibaby

Copy link
Copy Markdown
Contributor

When creating a sandbox, merge the template metadata's Context.EnvVars (which contains Docker image ENV directives) into the sandbox config's Envd.Vars before sending them to envd via POST /init.

User-provided env vars from the SDK create() call take precedence over template defaults. Per-command env vars from process.start() still override both.

This fixes both the standard resume path and the filesystem-only cold boot (reboot) path, where DefaultUser and DefaultWorkdir were already restored from template metadata but EnvVars was not.

Closes #2268

/cc @jakubno @dobrac @ValentaTomas Would appreciate your review on this change, thanks!

When creating a sandbox, merge the template metadata's Context.EnvVars
(which contains Docker image ENV directives) into the sandbox config's
Envd.Vars before sending them to envd via POST /init.

User-provided env vars from the SDK create() call take precedence over
template defaults. Per-command env vars from process.start() still
override both.

This fixes both the standard resume path and the filesystem-only cold
boot (reboot) path, where DefaultUser and DefaultWorkdir were already
restored from template metadata but EnvVars was not.

Closes e2b-dev#2268

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker image ENV vars are not propagated to runtime sandbox processes

2 participants