mirror of https://github.com/docker/docs.git
parent
7c1d91e3cc
commit
d5293c2191
|
@ -867,7 +867,7 @@ like `RUN groupadd -r postgres && useradd --no-log-init -r -g postgres postgres`
|
||||||
Avoid installing or using `sudo` as it has unpredictable TTY and
|
Avoid installing or using `sudo` as it has unpredictable TTY and
|
||||||
signal-forwarding behavior that can cause problems. If you absolutely need
|
signal-forwarding behavior that can cause problems. If you absolutely need
|
||||||
functionality similar to `sudo`, such as initializing the daemon as `root` but
|
functionality similar to `sudo`, such as initializing the daemon as `root` but
|
||||||
running it as non-`root`), consider using ["gosu"](https://github.com/tianon/gosu).
|
running it as non-`root`, consider using [“gosu”](https://github.com/tianon/gosu).
|
||||||
|
|
||||||
Lastly, to reduce layers and complexity, avoid switching `USER` back and forth
|
Lastly, to reduce layers and complexity, avoid switching `USER` back and forth
|
||||||
frequently.
|
frequently.
|
||||||
|
@ -896,7 +896,7 @@ A Docker build executes `ONBUILD` commands before any command in a child
|
||||||
`ONBUILD` is useful for images that are going to be built `FROM` a given
|
`ONBUILD` is useful for images that are going to be built `FROM` a given
|
||||||
image. For example, you would use `ONBUILD` for a language stack image that
|
image. For example, you would use `ONBUILD` for a language stack image that
|
||||||
builds arbitrary user software written in that language within the
|
builds arbitrary user software written in that language within the
|
||||||
`Dockerfile`, as you can see in [Ruby’s `ONBUILD` variants](https://github.com/docker-library/ruby/blob/master/2.4/jessie/onbuild/Dockerfile).
|
`Dockerfile`, as you can see in [Ruby’s `ONBUILD` variants](https://github.com/docker-library/ruby/blob/c43fef8a60cea31eb9e7d960a076d633cb62ba8d/2.4/jessie/onbuild/Dockerfile).
|
||||||
|
|
||||||
Images built from `ONBUILD` should get a separate tag, for example:
|
Images built from `ONBUILD` should get a separate tag, for example:
|
||||||
`ruby:1.9-onbuild` or `ruby:2.0-onbuild`.
|
`ruby:1.9-onbuild` or `ruby:2.0-onbuild`.
|
||||||
|
|
Loading…
Reference in New Issue