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

args in marathon file does not resolve env variables #3416

Closed
triggity opened this issue Mar 7, 2016 · 4 comments
Closed

args in marathon file does not resolve env variables #3416

triggity opened this issue Mar 7, 2016 · 4 comments

Comments

@triggity
Copy link

triggity commented Mar 7, 2016

cmd field in a marathon app config would resolve environment variables before passing them in. this is documented here: https://mesosphere.github.io/marathon/docs/ports.html

however, the args field does not have it's environment variables resolved before passing in.
Is this a bug or deliberate and missing from the documentation?

a canonical example:

using a basic image with

ENTRYPOINT ["echo"]

and args: [ "$PORT0"]

the container logs show it echoing
$PORT0 instead of the expected resolved env variable for $PORT0

@aquamatthias
Copy link
Contributor

Hey @triggity the args are passed directly to the exec syscall without running a shell. This is intended behavior. If you need env expansion please use cmd instead of args

@micahhausler
Copy link
Contributor

@aquamatthias So is it impossible to pass a command to a docker container and have an environment variable be interpreted in that command? cmd is incompatible with a container in an app definition.

@aquamatthias
Copy link
Contributor

@micahhausler Don't know what you mean by incompatible. Please see https://mesosphere.github.io/marathon/docs/native-docker.html, especially the Command vs Args section.

@micahhausler
Copy link
Contributor

I see what you mean now. I got confused because the cmd doesn't respect the docker container's entrypoint.

@mesosphere mesosphere locked and limited conversation to collaborators Mar 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants