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

Support .env file for docker compose #95

Open
TJM opened this issue Nov 27, 2018 · 2 comments
Open

Support .env file for docker compose #95

TJM opened this issue Nov 27, 2018 · 2 comments

Comments

@TJM
Copy link

TJM commented Nov 27, 2018

Similar to #44 I think, but maybe the situation is different 2 years later?

I am trying to convert https://github.com/jfrog/artifactory-docker-examples/tree/master/docker-compose/xray

$ container-transform -i compose -o marathon xray.yml
Traceback (most recent call last):
(SNIP)
ValueError: invalid literal for int() with base 10: '$XRAY_SERVER_PORT'

Apparently they are using the ".env" file as per https://docs.docker.com/compose/environment-variables/#the-env-file

It seems like container-transform would need to parse the compose file the same way docker compose does to produce the same results?

I tried appending the variables to the "docker-compose.yaml" (xray.yml) file, but the results were not positive either.

$ echo '' >> xray.yml # add a newline to the end of the file
$ sed -e 's/=/: /' .env >> xray.yml

... same error :(

~tommy

@Dzhuneyt
Copy link

Dzhuneyt commented May 9, 2019

This is definitely needed. I tried using docker-compose config | container-transform -v which in theory should output the YML file with dynamic values retrieved from the .env file and pass them to container-transform, but I get the same error:

    'container_port': int(parts[1]),
ValueError: invalid literal for int() with base 10: '80/tc'

@Dzhuneyt
Copy link

Dzhuneyt commented May 9, 2019

Actually, now I just noticed that the issue (error) was caused when I declare the ports using: - 8888:80/tcp instead of - 8888:80. Still a thing to be fixed in my opinion.

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