8000 Update best practices for entrypoint. by SvenDowideit · Pull Request #10724 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update best practices for entrypoint. #10724

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

Merged
merged 2 commits into from
Feb 24, 2015

Conversation

SvenDowideit
Copy link
Contributor

takeover #10470

@jfrazelle :)

@SvenDowideit
Copy link
Contributor Author

@fredlf @jamtur01

The best use for `ENTRYPOINT` is as a helper script. Using `ENTRYPOINT` for
other tasks can make your code harder to understand. For example,
The best use for `ENTRYPOINT` is to set the image's main command, allowing that
image to be run as though it was that command (and then to use `CMD` the default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its missing an "as".
...then to use CMD as the default options).

@jessfraz
Copy link
Contributor

yayyy thanks @SvenDowideit you da best :D


COPY ./docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]

This script will allow the user to just start Postgres:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will help to give the reader a heads up for what is coming. E.g., "This script allows the user to interact with Postgres in several ways. It can simply start Postgres: $ docker run postgres. Or, it can be used to run Postgres and pass parameters to the server: $ docker run postgres postres --help. Lastly, it could also be used to start a totally different tool, such Bash:

@fredlf
Copy link
Contributor
fredlf commented Feb 13, 2015

Needs a few edits/revisions to clear up some ambiguities.

@SvenDowideit
Copy link
Contributor Author

other tasks can make your code harder to understand. For example,
The best use for `ENTRYPOINT` is to set the image's main command, allowing that
image to be run as though it was that command (and then use `CMD` as the default
options).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flags?

jessfraz and others added 2 commits February 23, 2015 12:00
Despite being wrong we are kinda calling our users dumb, I feel it is a bit
demeaning. As well as just wrong.

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <hugs@docker.com> (github: jfrazelle)
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
@SvenDowideit
Copy link
Contributor Author

@jamtur01
Copy link
Contributor

LGTM

@@ -626,8 +626,7 @@ ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]

If you need to write a starter script for a single executable, you can ensure that
the final executable receives the Unix signals by using `exec` and `gosu`
(see [the Dockerfile best practices](/articles/dockerfile_best-practices/#entrypoint)
for more details):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we remove this link?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because that link doesn't tell the reader anything about exec and gosu - and much of the content about using ENTRYPOINT isn't there, its in the builder doc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, okay. I see there's a link to the Best Practices doc at the top of the page, so I'm fine removing this one, then.

@fredlf
Copy link
Contributor
fredlf commented Feb 23, 2015

LGTM

SvenDowideit added a commit that referenced this pull request Feb 24, 2015
Update best practices for entrypoint.
@SvenDowideit SvenDowideit merged commit 1d27930 into moby:master Feb 24, 2015
SvenDowideit added a commit to SvenDowideit/docker that referenced this pull request Feb 26, 2015
Update best practices for entrypoint.
(cherry picked from commit 1d27930)
@SvenDowideit SvenDowideit deleted the takeover-10470 branch April 26, 2015 23:38
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.

8 participants
0