Вот что произошло: я создал образ докера со стеком, но процесс прерывался пять раз.В сообщении говорится, что каждое прерывание происходило при сборке пакета Cabal-2.4.1.0.Процесс завершился с кодом: ExitFailure (-9) (THIS MAY INDICATE OUT OF MEMORY)
.
Я хочу автоматизировать процесс в docker-скрипте, поэтому очень важно, чтобы стек дошел до конца.Это моя проблема.Вот что произошло при сборке (я пропустил несколько строк, чтобы прокрутка была в разумных пределах, поэтому время от времени ожидайте увидеть <... skipping <n> lines ...>
).(продолжение следует внизу.)
BA92-C02VP224HTDF:Ampersand stefjoosten$ docker build -t amp:latest .
Sending build context to Docker daemon 70.28MB
Step 1/8 : FROM ubuntu:latest
---> 7698f282e524
Step 2/8 : RUN apt-get update && apt-get --yes install curl && apt-get --yes install git-core
---> Using cache
---> 81322e02eb2a
Step 3/8 : RUN curl -sSL https://get.haskellstack.org/ | sh # install Haskell and stack
---> Using cache
---> 0ff9ca0665b9
Step 4/8 : WORKDIR /Ampersand/ # build from the Ampersand source code directory
---> Using cache
---> a66b539a6868
Step 5/8 : RUN git clone https://github.com/AmpersandTarski/Ampersand/ .
---> Using cache
---> 1806c9a40c82
Step 6/8 : RUN git checkout feature/rio-phase2 # get Ampersand sources in the correct version
---> Using cache
---> 456074437186
Step 7/8 : RUN stack setup # set up Haskell stack (version taken from stack.yaml)
---> Using cache
---> fcadefd6812c
Step 8/8 : RUN stack install # installs Ampersand executables in /root/.local/bin
---> Running in 0a8d298a757c
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpcomplete.com/) ...
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading root
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading timestamp
Downloading snapshot
Downloading mirrors
Cannot update index (no local copy)
Downloading index
Updated package index downloaded
Update complete
Populating index cache ...
Populated index cache.
[1 of 2] Compiling Main ( /root/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /root/.stack/setup-exe-src/setup-mPHDZzAJ.o )
[2 of 2] Compiling StackSetupShim ( /root/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /root/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
Linking /root/.stack/setup-exe-cache/x86_64-linux/tmp-Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.4 ...
Cabal-2.4.1.0: download
StateVar-1.1.1.1: download
HsYAML-0.1.1.3: download
StateVar-1.1.1.1: configure
SHA-1.6.4.4: download
StateVar-1.1.1.1: build
HsYAML-0.1.1.3: configure
HsYAML-0.1.1.3: build
Cabal-2.4.1.0: configure
StateVar-1.1.1.1: copy/register
<... skipping 55 lines ...>
cereal-0.5.8.0: download
cereal-0.5.8.0: configure
cereal-0.5.8.0: build
basement-0.0.10: copy/register
cereal-0.5.8.0: copy/register
blaze-html-0.9.1.1: copy/register
-- While building package Cabal-2.4.1.0 using:
/root/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.4 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.4.0.1 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure (-9) (THIS MAY INDICATE OUT OF MEMORY)
Logs have been written to: /Ampersand/ # build from the Ampersand source code directory/.stack-work/logs/Cabal-2.4.1.0.log
Configuring Cabal-2.4.1.0...
Preprocessing library for Cabal-2.4.1.0..
Building library for Cabal-2.4.1.0..
[ 1 of 220] Compiling Distribution.Compat.Binary ( Distribution/Compat/Binary.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Compat/Binary.o )
[ 2 of 220] Compiling Distribution.Compat.Directory ( Distribution/Compat/Directory.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Compat/Directory.o )
[ 3 of 220] Compiling Distribution.Compat.Exception ( Distribution/Compat/Exception.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Compat/Exception.o )
[ 4 of 220] Compiling Distribution.Compat.Internal.TempFile ( Distribution/Compat/Internal/TempFile.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Compat/Internal/TempFile.o )
[ 5 of 220] Compiling Distribution.Compat.MonadFail ( Distribution/Compat/MonadFail.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Compat/MonadFail.o )
[ 6 of 220] Compiling Distribution.Compat.Newtype ( Distribution/Compat/Newtype.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Compat/Newtype.o )
<... skipping 56 lines ...>
[ 63 of 220] Compiling Distribution.System ( Distribution/System.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/System.o )
[ 64 of 220] Compiling Distribution.SPDX.LicenseReference ( Distribution/SPDX/LicenseReference.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/SPDX/LicenseReference.o )
[ 65 of 220] Compiling Distribution.SPDX.LicenseId ( Distribution/SPDX/LicenseId.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/SPDX/LicenseId.o )
The command '/bin/sh -c stack install # installs Ampersand executables in /root/.local/bin' returned a non-zero code: 1
BA92-C02VP224HTDF:Ampersand stefjoosten$ docker start `docker ps -q -l` # restart it in the background
0a8d298a757c
BA92-C02VP224HTDF:Ampersand stefjoosten$ docker attach `docker ps -q -l`
cmark-gfm-0.1.8: build
clock-0.7.2: copy/register
colour-2.3.4: download
colour-2.3.4: configure
colour-2.3.4: build
<... skipping 200 lines ...>
primitive-0.6.4.0: copy/register
reflection-2.1.4: copy/register
hxt-9.3.1.16: copy/register
-- While building package Cabal-2.4.1.0 using:
/root/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.4 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.4.0.1 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure (-9) (THIS MAY INDICATE OUT OF MEMORY)
Logs have been written to: /Ampersand/ # build from the Ampersand source code directory/.stack-work/logs/Cabal-2.4.1.0.log
Configuring Cabal-2.4.1.0...
Preprocessing library for Cabal-2.4.1.0..
Building library for Cabal-2.4.1.0..
[ 1 of 220] Compiling Distribution.Compat.Binary ( Distribution/Compat/Binary.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Compat/Binary.o )
[ 2 of 220] Compiling Distribution.Compat.Directory ( Distribution/Compat/Directory.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Compat/Directory.o )
[ 3 of 220] Compiling Distribution.Compat.Exception ( Distribution/Compat/Exception.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Compat/Exception.o )
[ 4 of 220] Compiling Distribution.Compat.Internal.TempFile ( Distribution/Compat/Internal/TempFile.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Compat/Internal/TempFile.o )
[ 5 of 220] Compiling Distribution.Compat.MonadFail ( Distribution/Compat/MonadFail.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Compat/MonadFail.o )
[ 6 of 220] Compiling Distribution.Compat.Newtype ( Distribution/Compat/Newtype.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Compat/Newtype.o )
<... skipping 104 lines ...>
[111 of 220] Compiling Distribution.Types.AbiDependency ( Distribution/Types/AbiDependency.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Types/AbiDependency.o )
[112 of 220] Compiling Distribution.Simple.InstallDirs ( Distribution/Simple/InstallDirs.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Simple/InstallDirs.o )
[113 of 220] Compiling Distribution.Types.LegacyExeDependency ( Distribution/Types/LegacyExeDependency.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Types/LegacyExeDependency.o )
[114 of 220] Compiling Distribution.Types.BuildInfo ( Distribution/Types/BuildInfo.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Distribution/Types/BuildInfo.o )
BA92-C02VP224HTDF:Ampersand stefjoosten$ docker start `docker ps -q -l` # restart it in the background
0a8d298a757c
BA92-C02VP224HTDF:Ampersand stefjoosten$ docker attach `docker ps -q -l`
regex-base-0.93.2: copy/register
regex-pcre-builtin-0.94.4.8.8.35: download
<... skipping 678 lines with three more interruptions ...>
pandoc-2.5: copy/register
pandoc-crossref-0.3.4.0: download
pandoc-crossref-0.3.4.0: configure
pandoc-crossref-0.3.4.0: build
pandoc-crossref-0.3.4.0: copy/register
Building all executables for `ampersand' once. After a successful build of all of them, only specified executables will be rebuilt.
ampersand-3.17.0: configure (lib + exe)
[1 of 2] Compiling Main ( /Ampersand/ # build from the Ampersand source code directory/Setup.hs, /Ampersand/ # build from the Ampersand source code directory/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/setup/Main.o )
[2 of 2] Compiling StackSetupShim ( /root/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /Ampersand/ # build from the Ampersand source code directory/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/setup/StackSetupShim.o )
Linking /Ampersand/ # build from the Ampersand source code directory/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/setup/setup ...
Configuring ampersand-3.17.0...
ampersand-3.17.0: build (lib + exe)
Warning: Cannot read previously generated src/Ampersand/Prototype/StaticFiles_Generated.hs:
src/Ampersand/Prototype/StaticFiles_Generated.hs: openFile: does not exist (No such file or directory)
This warning should disappear the next time you build Ampersand. If the error persists, please report this as a bug.
Static files have changed, updating src/Ampersand/Prototype/StaticFiles_Generated.hs
Preprocessing library for ampersand-3.17.0..
Building library for ampersand-3.17.0..
[ 1 of 113] Compiling Ampersand.Basics.Prelude ( src/Ampersand/Basics/Prelude.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Ampersand/Basics/Prelude.o )
[ 2 of 113] Compiling Ampersand.Basics.Languages ( src/Ampersand/Basics/Languages.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Ampersand/Basics/Languages.o )
[ 3 of 113] Compiling Ampersand.Basics.Exit ( src/Ampersand/Basics/Exit.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Ampersand/Basics/Exit.o )
[ 4 of 113] Compiling Ampersand.Basics.BuildInfo_Generated ( src/Ampersand/Basics/BuildInfo_Generated.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Ampersand/Basics/BuildInfo_Generated.o )
[ 5 of 113] Compiling Ampersand.Basics.Auxiliaries ( src/Ampersand/Basics/Auxiliaries.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Ampersand/Basics/Auxiliaries.o )
[ 6 of 113] Compiling Ampersand.Basics.String ( src/Ampersand/Basics/String.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Ampersand/Basics/String.o )
<... skipping 103 lines ...>
[110 of 113] Compiling Ampersand.Test ( src/Ampersand/Test.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Ampersand/Test.o )
[111 of 113] Compiling Ampersand ( src/Ampersand.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Ampersand.o )
[112 of 113] Compiling MainApps ( src/MainApps.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/MainApps.o )
[113 of 113] Compiling Paths_ampersand ( .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/autogen/Paths_ampersand.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Paths_ampersand.o )
Preprocessing executable 'ampersand' for ampersand-3.17.0..
Building executable 'ampersand' for ampersand-3.17.0..
[1 of 2] Compiling Main ( app/Ampersand/Main.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/ampersand/ampersand-tmp/Main.o )
[2 of 2] Compiling Paths_ampersand ( .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/ampersand/autogen/Paths_ampersand.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/ampersand/ampersand-tmp/Paths_ampersand.o )
Linking .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/ampersand/ampersand ...
ampersand-3.17.0: copy/register
Installing library in /Ampersand/ # build from the Ampersand source code directory/.stack-work/install/x86_64-linux/lts-13.16/8.6.4/lib/x86_64-linux-ghc-8.6.4/ampersand-3.17.0-K72VvTMgyU7EFfE6avLPOe
Installing executable ampersand in /Ampersand/ # build from the Ampersand source code directory/.stack-work/install/x86_64-linux/lts-13.16/8.6.4/bin
Registering library for ampersand-3.17.0..
Completed 25 action(s).
Copying from /Ampersand/ # build from the Ampersand source code directory/.stack-work/install/x86_64-linux/lts-13.16/8.6.4/bin/ampersand to /root/.local/bin/ampersand
Copied executables to /root/.local/bin:
- ampersand
Странно видеть, что процесс сборки прерывается по (возможной) причине исчерпания памяти, но процесс успешно продолжается после перезапуска процесса сборки докера,Мне потребовалось 5 перезапусков, чтобы дойти до конца.
Я пытался увеличить память докера, экспериментируя с командами:
docker build -m 4g -t amp:latest .
docker build -m 12g -t amp:latest .
, но это не делает заметной разницы.
Буду благодарен за любые идеи ...