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

Substitution with service environment #1004

Merged

Conversation

lisongmin
Copy link
Contributor

@lisongmin lisongmin commented Jul 19, 2024

This pr add the ability to substitute the variable with the service's environment.
This allows the use the service's environment within the service block itself.

For instance, in the provided example:

services:
  app:
    image: "abc:${version}"
    build:
      context: .
      args:
        VERSION: "${version}"
    environment:
      version: v1.0

The version environment is defined within the app service and
it is then used to define the image and VERSION build argument
for the same service.

@lisongmin lisongmin force-pushed the substitution-with-service-environment branch from 56d7744 to 2f5e548 Compare July 19, 2024 18:58
Copy link
Collaborator

@p12tic p12tic left a comment

Choose a reason for hiding this comment

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

Looks great, thanks. I had one comment, but aside from that the PR can go in.

This commit introduces the ability to substitute environment variables
within the 'environment' section of the service definition.

This allows for more dynamic configuration of services.

Signed-off-by: Songmin Li <lisongmin@protonmail.com>
Signed-off-by: Songmin Li <lisongmin@protonmail.com>
@p12tic p12tic force-pushed the substitution-with-service-environment branch from 420e5a0 to 34f5268 Compare July 26, 2024 21:04
@p12tic
Copy link
Collaborator

p12tic commented Jul 26, 2024

Rebased.

@p12tic p12tic merged commit 585d344 into containers:main Jul 26, 2024
8 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.

None yet

2 participants