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

$CurrentContainer cannot be initialized when -only-exposed is used #458

Open
bap2pecs opened this issue Sep 2, 2022 · 0 comments
Open
Labels

Comments

@bap2pecs
Copy link

bap2pecs commented Sep 2, 2022

If using docker-gen and nginx separately instead of nginx-proxy, the official template does not work when -only-exposed (or -only-published) is used.

After debugging, I found out that the root cause is $CurrentContainer is not initialized properly. This is expected because the docker-gen container does not expose any ports. So

{{ $CurrentContainer := where $ "ID" .Docker.CurrentContainerID | first }}

cannot find the docker-gen container inside $ (the list of all containers)

A possible solution is to explicitly expose .CurrentContainer as a top-level argument to the template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants