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

Don't run the entrypoint for each line in a multi-line script #121

Merged
merged 1 commit into from
Sep 17, 2018

Conversation

JonathonReinhart
Copy link
Owner

@JonathonReinhart JonathonReinhart commented Sep 11, 2018

This is a breaking change. It was decided that this is not a breaking change. This installs the originally-intended behavior. If someone really wants the old behavior, please open an issue and we can add a flag that does so.

Fixes #114

@JonathonReinhart JonathonReinhart changed the title scuba: Don't run the entrypoint for each line in a multi-line script Don't run the entrypoint for each line in a multi-line script Sep 11, 2018
@JonathonReinhart JonathonReinhart force-pushed the 114-fix-entrypoint-semantics branch 2 times, most recently from a0f1964 to 09ebaf0 Compare September 14, 2018 13:02
**This is a breaking change.**

The previous logic was generally incorrect. For a multi-line script,
Scuba would prepend each line with the entrypoint. This sort of makes
sense, except the script is run within *one*  `docker run` invocation.
Many image entrypoints are wrappers which set up things in the
container, and then execute the user command which is passed as
arguments to the entrypoint (e.g. `exec "@"`). Thus, it isn't right to
execute the entrypoint multiple times in the same container.

This changes the behavior of Scuba to instead invoke the entrypoint,
passing it the path of the scuba-generated script to be executed. In
this way, the entrypoint is only run once.

N.B. This means that Scuba no longer works with images which wrap a
single command (e.g. an "application" image which sets some CLI
application as the entrypoint). If this use case is needed in the
future, an additional YAML option (e.g. `entrypoint_each_line`) could be
added to restore the old behavior.

Fixes #114
@JonathonReinhart JonathonReinhart merged commit ad95055 into master Sep 17, 2018
@JonathonReinhart JonathonReinhart deleted the 114-fix-entrypoint-semantics branch September 17, 2018 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scuba Runs the Entrypoint Before Every Command
1 participant