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

[Bug]: Shared variables not substituted in Docker Compose projects #2169

Open
colinmollenhour opened this issue May 8, 2024 · 0 comments
Open
Assignees

Comments

@colinmollenhour
Copy link

Description

According to the docs I should be able to use shared variables like {{team.VAR}}. However, if I use these in a docker-compose.yaml file like below, they are not substituted:

services:
  mariadb:
    image: mariadb
    environment:
      - MYSQL_USER_PASSWORD={{team.MYSQL_PASSWORD}}

Discussion started here with no response: https://discord.com/channels/459365938081431553/1228241023487184907/1228241023487184907

Maybe I'm misunderstanding where these substitutions can occur? It is not clear at all from the docs.

Minimal Reproduction (if possible, example repository)

Create a Team variable called SENDGRID_API_KEY, reference it in a docker-compose.yaml file and create a resource using the Docker Compose file. Inspect the docker container to see if the environment was set correctly.

services:
  web:
    image: nginxdemos/hello
    volumes: 'web:/app'
    environment:
      - MYVAR=Testing...
      - SG_API_KEY='{{team.SENDGRID_API_KEY}}'
      - SG_API_KEY2={{team.SENDGRID_API_KEY}}

The docker inspect command shows this:

            "Env": [
                "SG_API_KEY2={{team.SENDGRID_API_KEY}}",
                "MYVAR=Testing...",
                "SG_API_KEY='{{team.SENDGRID_API_KEY}}'",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NGINX_VERSION=1.25.5",
                "PKG_RELEASE=1",
                "NJS_VERSION=0.8.4",
                "NJS_RELEASE=3"
            ],

Exception or Error

No response

Version

v4.0.0-beta.276

@andrasbacsai andrasbacsai self-assigned this May 15, 2024
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

No branches or pull requests

2 participants