@@ -311,7 +311,7 @@ persisted across runs, this means that if you `stack exec sudo apt-get install
311311some-ubuntu-package`, that package will be installed but then the container it's
312312installed in will disappear, thus causing it to have no effect. If you wish to
313313make this kind of change permanent, see later instructions for how to create a
314- [ derivative Docker image] ( #derivativeimage ) .
314+ [ derivative Docker image] ( #derivative-image ) .
315315
316316Inside the container, your home directory is a special location that volume-
317317mounted from within your project directory's ` .stack-work ` in such a
@@ -353,26 +353,27 @@ information about managing Docker containers.
353353
354354Creating your own custom derivative image can be useful if you need to install
355355additional Ubuntu packages or make other changes to the operating system. Here
356- is an example (replace ` custom ` if you prefer a different name for your derived
357- container):
356+ is an example (replace ` stack-build:custom ` if you prefer a different name for
357+ your derived container, but it's best if the repo name matches what you're
358+ deriving from, only with a different tag, to avoid recompilation):
358359
359- # On host
360- $ stack --docker-persist --docker-container-name=temp exec --plain bash
360+ ;;; On host
361+ $ sudo stack --docker-persist --docker-container-name=temp exec bash
361362
362- # In container, make changes to OS
363- $ sudo apt-get install r-cran-numderiv
363+ ;;; In container, make changes to OS
364+ # apt-get install r-cran-numderiv
364365 [...]
365- $ exit
366+ # exit
366367
367- # On host again
368- $ docker commit temp custom
368+ ;;; On host again
369+ $ docker commit temp stack-build: custom
369370 $ docker rm temp
370371
371- Now you have a new Docker image named ` custom ` . To use the new image, run
372+ Now you have a new Docker image named ` stack-build: custom` . To use the new image, run
372373a command such as the following or update the corresponding values in your
373374` stack.yaml ` :
374375
375- stack --docker-image=custom <COMMAND>
376+ stack --docker-image=stack-build: custom <COMMAND>
376377
377378Note, however, that any time a new image is used, you will have to re-do this
378379process. You could also use a Dockerfile to make this reusable. Consult the
0 commit comments