Fix quoting of exec argument in the entrypoint script #492
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New Behavior
This fixes improper quoting in the
exec
at the end of the Docker entrypoint."$@"
is equivalent to"$1" "$2" ...
in bash. Fixing this allows Docker commands (CMD) with spaces in them to be passed through this entrypoint script.Contrast to Current Behavior
There is no change in behavior of the container if launched with the default arguments, but we're now able to override the Docker command with something like
sh -c "echo hello ; /opt/netbox/launch-netbox.sh"
to do something before the application starts. I'm using this to test quick, trivial fixes to the container rather than rebuilding the container with a new entrypoint or launch script.Discussion: Benefits and Drawbacks
There's no downside here. All existing behavior is maintained.
There's a relevant shellcheck test disabled here that was added, seemingly unrelatedly, in #163 . The shellcheck error tells us to use these quotes.
Changes to the Wiki
None
Proposed Release Note Entry
This probably isn't worth mentioning in the release notes, but:
The container can now be started properly with an overridden Docker command.
Double Check
develop
branch.