fix(docker): use target binary build param as name of image entrypoint #1573
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.
Summary
Fixes container images to use the
$TARGETBINARYbuild param as the name of the binary run in the image entrypoint.Background
Before this patch, the containerfile entrypoint used a symlinked
/usr/local/bin/entrypointas the entrypoint, which caused the name of the binary to be"entrypoint". This itself was to workaround to theENTRYPOINTcommand not allowing for variables in exec form. This patch instead creates an ad-hoc script which itself executes$TARGETBINARY, and uses this script as the entrypoint.Together with the script using
execand the exec form ofENTRYPOINTthe expected binary (and process) name are used.Taking
astria-cli's help message as an example:Before:
After:
Changes
/usr/local/bin/entrypoint.shscript incontainerfiles/Dockerfilewhich is used as a new entrypoint and executes$TARGETBINARYTesting
Built and ran images using the dockerfile. No functionality was changed but the binary is
$TARGETBINARYand notentrypointnow.Related Issues
closes #1571