Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to pass environment variables in containers start() #3575

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

gabivlj
Copy link
Contributor

@gabivlj gabivlj commented Feb 19, 2025

We are just defining in the container capnp schema the environmentVariables property, and the env property in the start options.
The user will be able to pass environment variables like this:

this.ctx.container.start({ 
  env: {
    A: "C",
    C: "A",
  },
});

If the container image is already configured to have A=C, it will override it and set A to B. New environment variables are just appended. It's up to the container runtime to implement this behaviour correctly.

@gabivlj gabivlj requested review from a team as code owners February 19, 2025 23:32
@gabivlj gabivlj requested review from erikcorry and mar-cf February 19, 2025 23:32
@kentonv kentonv self-requested a review February 20, 2025 00:06
@gabivlj gabivlj force-pushed the gv/entrypoint branch 3 times, most recently from 40b8e4c to 7a71bd5 Compare February 20, 2025 18:18
@gabivlj gabivlj requested a review from kentonv February 20, 2025 18:21
@gabivlj gabivlj requested a review from a team as a code owner February 20, 2025 19:56
@gabivlj gabivlj force-pushed the gv/entrypoint branch 2 times, most recently from b02c9f0 to 76b08c0 Compare February 20, 2025 23:20
Copy link
Member

@kentonv kentonv left a comment

Choose a reason for hiding this comment

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

Looks good but you need to run the formatter.

@gabivlj gabivlj force-pushed the gv/entrypoint branch 2 times, most recently from dd9ec74 to 3c2666e Compare February 25, 2025 01:16
@gabivlj
Copy link
Contributor Author

gabivlj commented Feb 25, 2025

rebased

@gabivlj gabivlj enabled auto-merge February 25, 2025 20:41
@gabivlj gabivlj merged commit 40656b1 into cloudflare:main Feb 25, 2025
14 checks passed
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.

2 participants