Skip to content

Commit dac2d4a

Browse files
committed
Improve stack image container docs
* Lowercase is much easier to read * Remove mention of "add a hash" from the 'add' field, doesn't seem to have much to do with hashes * Use new `containers` syntax, to show how to have multiple docker containers See #3381.
1 parent 3027cf7 commit dac2d4a

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

doc/GUIDE.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,24 +2007,31 @@ to stack.yaml:
20072007
20082008
```yaml
20092009
image:
2010-
# YOU NEED A `container` YAML SECTION FOR `stack image container`
2011-
container:
2012-
# YOU NEED A BASE IMAGE NAME. STACK LAYERS EXES ON TOP OF
2013-
# THE BASE IMAGE. PREPARE YOUR PROJECT IMAGE IN ADVANCE. PUT
2014-
# ALL YOUR RUNTIME DEPENDENCIES IN THE IMAGE.
2015-
base: "fpco/ubuntu-with-libgmp:14.04"
2016-
# YOU CAN OPTIONALY NAME THE IMAGE. STACK WILL USE THE PROJECT
2017-
# DIRECTORY NAME IF YOU LEAVE OUT THIS OPTION.
2018-
name: "fpco/hello-world"
2019-
# OPTIONALLY ADD A HASH OF LOCAL PROJECT DIRECTORIES AND THEIR
2020-
# DESTINATIONS INSIDE THE DOCKER IMAGE.
2021-
add:
2022-
man/: /usr/local/share/man/
2023-
# OPTIONALLY SPECIFY A LIST OF EXECUTABLES. STACK WILL CREATE
2024-
# A TAGGED IMAGE FOR EACH IN THE LIST. THESE IMAGES WILL HAVE
2025-
# THEIR RESPECTIVE "ENTRYPOINT" SET.
2026-
entrypoints:
2027-
- stack
2010+
2011+
# You need a `containers` yaml section for `stack image container`.
2012+
# A `container` section that does not contain a list is also valid.
2013+
containers:
2014+
2015+
# This example just has one container.
2016+
-
2017+
# You need a base image name. Stack layers exes on top of
2018+
# the base image. Prepare your project image in advance by
2019+
# putting all your runtime dependencies in the image.
2020+
base: "fpco/ubuntu-with-libgmp:14.04"
2021+
2022+
# You can optionally name the image. Stack will use the project
2023+
# directory name if you leave out this option.
2024+
name: "fpco/hello-world"
2025+
2026+
# Optionally add a directory to a path inside the docker image.
2027+
add:
2028+
man/: /usr/local/share/man/
2029+
2030+
# Optionally specify a list of executables. Stack will create
2031+
# a tagged image for each in the list. these images will have
2032+
# their respective "ENTRYPOINT" set.
2033+
entrypoints:
2034+
- stack
20282035
```
20292036

20302037
and then run `stack image container` and then `docker images` to list

0 commit comments

Comments
 (0)