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

fix(docker): use target binary build param as name of image entrypoint #1573

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SuperFluffy
Copy link
Member

Summary

Fixes container images to use the $TARGETBINARY build 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/entrypoint as the entrypoint, which caused the name of the binary to be "entrypoint". This itself was to workaround to the ENTRYPOINT command 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 exec and the exec form of ENTRYPOINT the expected binary (and process) name are used.

Taking astria-cli's help message as an example:

Before:

Get the balance of a Sequencer account

Usage: entrypoint sequencer balance get [OPTIONS] <ADDRESS>

After:

Get the balance of a Sequencer account

Usage: astria-cli sequencer balance get [OPTIONS] <ADDRESS>

Changes

  • Create an adhoc /usr/local/bin/entrypoint.sh script in containerfiles/Dockerfile which is used as a new entrypoint and executes $TARGETBINARY

Testing

Built and ran images using the dockerfile. No functionality was changed but the binary is $TARGETBINARY and not entrypoint now.

Related Issues

closes #1571

@SuperFluffy SuperFluffy marked this pull request as ready for review September 26, 2024 15:46
@SuperFluffy SuperFluffy requested a review from a team as a code owner September 26, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Name of entrypoint should be target binary
2 participants