-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Remove CMD
host flag from Dockerfile
#4235
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4235 +/- ##
=======================================
Coverage 43.37% 43.37%
=======================================
Files 104 104
Lines 11938 11938
=======================================
Hits 5178 5178
Misses 6214 6214
Partials 546 546 Continue to review full report at Codecov.
|
Thanks for the contribution! We'll probably merge it this week, but the final decision is yet to be made. In any way, this is going to be in v0.108.0, since this will definitely break some people's installations if we're not careful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ameshkov thinks that this change as-is could break too many installations. To prevent a breaking change like that, could you add the -h
back, but put its value into an ENV
instruction? I.e. ENV AGH_BIND_HOST=0.0.0.0
. We'll then update the documentation to mention that people who want to bind to a specific address inside their containers should use --env AGH_BIND_HOST=192.168.1.1
.
OK, but exec form does not allow for shell expansion. Shell form can be used but does have caveats:
|
Sigh. Docker being Docker, heh. Something like this should probably work, albeit quite a hack: ENV AGH_BIND_HOST='0.0.0.0'
ENTRYPOINT [ \
"/bin/sh", \
"-c", \
"exec /opt/adguardhome/AdGuardHome --host \"$AGH_BIND_HOST\" \"$@\"", \
"--" \
]
CMD [ \
"--config", "/opt/adguardhome/conf/AdGuardHome.yaml", \
"--no-check-update", \
"--work-dir", "/opt/adguardhome/work" \
] |
Ehh that could work but do you want to have your Dockerfile looking like that? I'd say supporting environment variables is something that the binary itself should understand, without the need for flags in the middle. This does not feel like the correct way to do this. Since this is env vars, it might not be fair to restrict it to a single item. |
I think, we've had several issues about using the environment more actively. We'll need to think about it. But until then, this PR will remain open, if you don't mind. |
Necrobumping With the |
Also, since this setting will have previously configured a user's |
For anyone wanting to do this now, https://hub.docker.com/r/jsimon0/adguardhome |
Hello, With the upcoming command-line flags changes, we are going to deprecate the |
Hello again, We have implemented the requested changes in e54fc9b. Thank you for you help! |
This flag served no real purpose other than listening to all interfaces, despite selecting a specific interface during onboarding.
Also use long flags instead of shorthands
Closes #4231