nostrify icon indicating copy to clipboard operation
nostrify copied to clipboard

[bug]: Dockerfile does not build

Open chrisguida opened this issue 2 years ago • 3 comments

nostrify % docker build .
[+] Building 17.7s (21/23)                                                                                                                                                                                                                                     
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                      0.0s
 => => transferring dockerfile: 2.13kB                                                                                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                         0.0s
 => => transferring context: 2B                                                                                                                                                                                                                           0.0s
 => [internal] load metadata for docker.io/library/ubuntu:latest                                                                                                                                                                                          1.0s
 => [internal] load build context                                                                                                                                                                                                                         0.0s
 => => transferring context: 165.60kB                                                                                                                                                                                                                     0.0s
 => [builder 1/7] FROM docker.io/library/ubuntu:latest@sha256:67211c14fa74f070d27cc59d69a7fa9aeff8e28ea118ef3babc295a0428a6d21                                                                                                                            0.0s
 => CACHED [builder 2/7] RUN apt-get update -qq  && apt-get install -y --no-install-recommends  git build-essential autoconf automake build-essential git libtool libgmp-dev  libsqlite3-dev python3 python3-mako net-tools zlib1g-dev libsodium-dev  ge  0.0s
 => CACHED [builder 3/7] RUN git clone --recursive https://github.com/ElementsProject/lightning.git /tmp/lightning                                                                                                                                        0.0s
 => CACHED [builder 4/7] WORKDIR /tmp/lightning                                                                                                                                                                                                           0.0s
 => CACHED [builder 5/7] RUN git checkout master                                                                                                                                                                                                          0.0s
 => CACHED [builder 6/7] RUN ./configure --prefix=/tmp/lightning_install --enable-developer --disable-valgrind --enable-experimental-features                                                                                                             0.0s
 => CACHED [builder 7/7] RUN make -j $(nproc) install                                                                                                                                                                                                     0.0s
 => CACHED [final  2/13] COPY --from=builder /tmp/lightning_install/ /usr/local/                                                                                                                                                                          0.0s
 => CACHED [final  3/13] COPY --from=builder /tmp/lightning/ /usr/local/src/lightning/                                                                                                                                                                    0.0s
 => CACHED [final  4/13] RUN apt-get update -qq   && apt-get install -y --no-install-recommends   libsqlite3-dev   zlib1g-dev   libsodium-dev   libgmp-dev   python3   python3-pip   wget  git  tree   && rm -rf /var/lib/apt/lists/*                     0.0s
 => CACHED [final  5/13] RUN cd /tmp  && wget -qO bitcoin-24.0.1-x86_64-linux-gnu.tar.gz "https://bitcoincore.org/bin/bitcoin-core-24.0.1/bitcoin-24.0.1-x86_64-linux-gnu.tar.gz"  && BD=bitcoin-24.0.1/bin  && tar -xzvf bitcoin-24.0.1-x86_64-linux-gn  0.0s
 => CACHED [final  6/13] WORKDIR /build                                                                                                                                                                                                                   0.0s
 => [final  7/13] COPY . /build/                                                                                                                                                                                                                          0.0s
 => [final  8/13] RUN git submodule update --init --recursive                                                                                                                                                                                             0.9s
 => [final  9/13] ADD ci-requirements.txt /tmp/                                                                                                                                                                                                           0.0s
 => [final 10/13] RUN pip3 install /usr/local/src/lightning/contrib/pyln-client                                                                                                                                                                           4.9s
 => ERROR [final 11/13] RUN pip3 install /usr/local/src/lightning/contrib/pyln-testing                                                                                                                                                                   10.7s 
------                                                                                                                                                                                                                                                         
 > [final 11/13] RUN pip3 install /usr/local/src/lightning/contrib/pyln-testing:                                                                                                                                                                               
#21 0.502 Processing /usr/local/src/lightning/contrib/pyln-testing                                                                                                                                                                                             
#21 0.575   Installing build dependencies: started                                                                                                                                                                                                             
#21 1.846   Installing build dependencies: finished with status 'done'                                                                                                                                                                                         
#21 1.850   Getting requirements to build wheel: started                                                                                                                                                                                                       
#21 1.893   Getting requirements to build wheel: finished with status 'done'
#21 1.893   Preparing metadata (pyproject.toml): started
#21 2.009   Preparing metadata (pyproject.toml): finished with status 'done'
#21 2.014 Requirement already satisfied: pyln-client>=0.12.1 in /usr/local/lib/python3.10/dist-packages (from pyln-testing==23.2) (23.2)
#21 2.213 Collecting cheroot<9.0.0,>=8.6.0
#21 2.472   Downloading cheroot-8.6.0-py2.py3-none-any.whl (104 kB)
#21 2.523      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 104.7/104.7 KB 2.0 MB/s eta 0:00:00
#21 2.589 Collecting Flask<3.0.0,>=2.0.3
#21 2.628   Downloading Flask-2.2.3-py3-none-any.whl (101 kB)
#21 2.643      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 101.8/101.8 KB 7.1 MB/s eta 0:00:00
#21 2.882 Collecting protobuf<4,>=3.20.3
#21 2.920   Downloading protobuf-3.20.3-cp310-cp310-manylinux2014_aarch64.whl (918 kB)
#21 3.003      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 918.4/918.4 KB 11.2 MB/s eta 0:00:00
#21 3.084 Collecting ephemeral-port-reserve<2.0.0,>=1.1.4
#21 3.121   Downloading ephemeral_port_reserve-1.1.4-py2.py3-none-any.whl (4.4 kB)
#21 3.555 Collecting grpcio>=1.47
#21 3.622   Downloading grpcio-1.51.3-cp310-cp310-manylinux_2_17_aarch64.whl (71.5 MB)
#21 5.247      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 71.5/71.5 MB 21.4 MB/s eta 0:00:00
#21 5.413 Collecting psutil<6.0.0,>=5.9.0
#21 5.452   Downloading psutil-5.9.4.tar.gz (485 kB)
#21 5.462      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 485.8/485.8 KB 58.1 MB/s eta 0:00:00
#21 5.566   Installing build dependencies: started
#21 7.730   Installing build dependencies: finished with status 'done'
#21 7.734   Getting requirements to build wheel: started
#21 7.851   Getting requirements to build wheel: finished with status 'done'
#21 7.852   Preparing metadata (pyproject.toml): started
#21 7.968   Preparing metadata (pyproject.toml): finished with status 'done'
#21 8.053 Collecting psycopg2-binary<3.0.0,>=2.9.3
#21 8.093   Downloading psycopg2_binary-2.9.5-cp310-cp310-manylinux_2_24_aarch64.whl (3.4 MB)
#21 8.213      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.4/3.4 MB 28.4 MB/s eta 0:00:00
#21 8.289 Collecting pytest<8.0.0,>=7.0.1
#21 8.326   Downloading pytest-7.2.2-py3-none-any.whl (317 kB)
#21 8.336      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 317.2/317.2 KB 44.0 MB/s eta 0:00:00
#21 8.424 Collecting python-bitcoinlib<0.12.0,>=0.11.0
#21 8.533   Downloading python_bitcoinlib-0.11.2-py3-none-any.whl (104 kB)
#21 8.543      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 104.2/104.2 KB 17.9 MB/s eta 0:00:00
#21 8.624 Collecting jsonschema<5.0.0,>=4.4.0
#21 8.661   Downloading jsonschema-4.17.3-py3-none-any.whl (90 kB)
#21 8.667      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.4/90.4 KB 21.9 MB/s eta 0:00:00
#21 8.739 Collecting six>=1.11.0
#21 8.774   Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
#21 8.835 Collecting more-itertools>=2.6
#21 8.870   Downloading more_itertools-9.1.0-py3-none-any.whl (54 kB)
#21 8.878      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.2/54.2 KB 8.6 MB/s eta 0:00:00
#21 8.936 Collecting jaraco.functools
#21 8.975   Downloading jaraco.functools-3.6.0-py3-none-any.whl (7.9 kB)
#21 9.029 Collecting Jinja2>=3.0
#21 9.071   Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB)
#21 9.078      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 KB 29.3 MB/s eta 0:00:00
#21 9.146 Collecting Werkzeug>=2.2.2
#21 9.183   Downloading Werkzeug-2.2.3-py3-none-any.whl (233 kB)
#21 9.193      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 233.6/233.6 KB 29.5 MB/s eta 0:00:00
#21 9.253 Collecting click>=8.0
#21 9.288   Downloading click-8.1.3-py3-none-any.whl (96 kB)
#21 9.294      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 KB 23.6 MB/s eta 0:00:00
#21 9.346 Collecting itsdangerous>=2.0
#21 9.384   Downloading itsdangerous-2.1.2-py3-none-any.whl (15 kB)
#21 9.458 Collecting attrs>=17.4.0
#21 9.494   Downloading attrs-22.2.0-py3-none-any.whl (60 kB)
#21 9.499      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.0/60.0 KB 16.1 MB/s eta 0:00:00
#21 9.565 Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
#21 9.601   Downloading pyrsistent-0.19.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (117 kB)
#21 9.607      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.2/117.2 KB 22.8 MB/s eta 0:00:00
#21 9.621 Requirement already satisfied: pyln-bolt7>=1.0 in /usr/local/lib/python3.10/dist-packages (from pyln-client>=0.12.1->pyln-testing==23.2) (1.0.246)
#21 9.621 Requirement already satisfied: pyln-proto>=0.12 in /usr/local/lib/python3.10/dist-packages (from pyln-client>=0.12.1->pyln-testing==23.2) (23.2)
#21 9.681 Collecting packaging
#21 9.717   Downloading packaging-23.0-py3-none-any.whl (42 kB)
#21 9.720      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.7/42.7 KB 17.8 MB/s eta 0:00:00
#21 9.764 Collecting iniconfig
#21 9.800   Downloading iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
#21 9.853 Collecting pluggy<2.0,>=0.12
#21 9.888   Downloading pluggy-1.0.0-py2.py3-none-any.whl (13 kB)
#21 9.938 Collecting exceptiongroup>=1.0.0rc8
#21 9.983   Downloading exceptiongroup-1.1.1-py3-none-any.whl (14 kB)
#21 10.04 Collecting tomli>=1.0.0
#21 10.07   Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
#21 10.18 Collecting MarkupSafe>=2.0
#21 10.22   Downloading MarkupSafe-2.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (26 kB)
#21 10.23 Requirement already satisfied: base58<3.0.0,>=2.1.1 in /usr/local/lib/python3.10/dist-packages (from pyln-proto>=0.12->pyln-client>=0.12.1->pyln-testing==23.2) (2.1.1)
#21 10.23 Requirement already satisfied: coincurve<18.0.0,>=17.0.0 in /usr/local/lib/python3.10/dist-packages (from pyln-proto>=0.12->pyln-client>=0.12.1->pyln-testing==23.2) (17.0.0)
#21 10.23 Requirement already satisfied: PySocks<2.0.0,>=1.7.1 in /usr/local/lib/python3.10/dist-packages (from pyln-proto>=0.12->pyln-client>=0.12.1->pyln-testing==23.2) (1.7.1)
#21 10.23 Requirement already satisfied: cryptography<37.0.0,>=36.0.1 in /usr/local/lib/python3.10/dist-packages (from pyln-proto>=0.12->pyln-client>=0.12.1->pyln-testing==23.2) (36.0.2)
#21 10.23 Requirement already satisfied: bitstring<4.0.0,>=3.1.9 in /usr/local/lib/python3.10/dist-packages (from pyln-proto>=0.12->pyln-client>=0.12.1->pyln-testing==23.2) (3.1.9)
#21 10.26 Requirement already satisfied: cffi>=1.3.0 in /usr/local/lib/python3.10/dist-packages (from coincurve<18.0.0,>=17.0.0->pyln-proto>=0.12->pyln-client>=0.12.1->pyln-testing==23.2) (1.15.1)
#21 10.26 Requirement already satisfied: asn1crypto in /usr/local/lib/python3.10/dist-packages (from coincurve<18.0.0,>=17.0.0->pyln-proto>=0.12->pyln-client>=0.12.1->pyln-testing==23.2) (1.5.1)
#21 10.27 Requirement already satisfied: pycparser in /usr/local/lib/python3.10/dist-packages (from cffi>=1.3.0->coincurve<18.0.0,>=17.0.0->pyln-proto>=0.12->pyln-client>=0.12.1->pyln-testing==23.2) (2.21)
#21 10.27 Building wheels for collected packages: pyln-testing, psutil
#21 10.28   Building wheel for pyln-testing (pyproject.toml): started
#21 10.42   Building wheel for pyln-testing (pyproject.toml): finished with status 'done'
#21 10.43   Created wheel for pyln-testing: filename=pyln_testing-23.2-py3-none-any.whl size=65526 sha256=f98d856931101d2470563547f46cda3ceed592d04b08b01adad6fd1f4661b9b9
#21 10.43   Stored in directory: /root/.cache/pip/wheels/47/1c/83/663226045e57eea50d0621ec5862055824d4fadc5e99b0d8a8
#21 10.43   Building wheel for psutil (pyproject.toml): started
#21 10.54   Building wheel for psutil (pyproject.toml): finished with status 'error'
#21 10.54   error: subprocess-exited-with-error
#21 10.54   
#21 10.54   × Building wheel for psutil (pyproject.toml) did not run successfully.
#21 10.54   │ exit code: 1
#21 10.54   ╰─> [42 lines of output]
#21 10.54       running bdist_wheel
#21 10.54       running build
#21 10.54       running build_py
#21 10.54       creating build
#21 10.54       creating build/lib.linux-aarch64-3.10
#21 10.54       creating build/lib.linux-aarch64-3.10/psutil
#21 10.54       copying psutil/_psosx.py -> build/lib.linux-aarch64-3.10/psutil
#21 10.54       copying psutil/_psaix.py -> build/lib.linux-aarch64-3.10/psutil
#21 10.54       copying psutil/_pswindows.py -> build/lib.linux-aarch64-3.10/psutil
#21 10.54       copying psutil/_psposix.py -> build/lib.linux-aarch64-3.10/psutil
#21 10.54       copying psutil/_common.py -> build/lib.linux-aarch64-3.10/psutil
#21 10.54       copying psutil/__init__.py -> build/lib.linux-aarch64-3.10/psutil
#21 10.54       copying psutil/_compat.py -> build/lib.linux-aarch64-3.10/psutil
#21 10.54       copying psutil/_psbsd.py -> build/lib.linux-aarch64-3.10/psutil
#21 10.54       copying psutil/_pssunos.py -> build/lib.linux-aarch64-3.10/psutil
#21 10.54       copying psutil/_pslinux.py -> build/lib.linux-aarch64-3.10/psutil
#21 10.54       creating build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_testutils.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_process.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_osx.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_unicode.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/__init__.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_bsd.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_connections.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_misc.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/__main__.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_memleaks.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_system.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_windows.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_aix.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/runner.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_sunos.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_contracts.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_posix.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       copying psutil/tests/test_linux.py -> build/lib.linux-aarch64-3.10/psutil/tests
#21 10.54       running build_ext
#21 10.54       creating build/temp.linux-aarch64-3.10
#21 10.54       creating build/temp.linux-aarch64-3.10/psutil
#21 10.54       aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=594 -DPy_LIMITED_API=0x03060000 -DPSUTIL_LINUX=1 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -I/usr/include/python3.10 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-3.10/psutil/_psutil_common.o
#21 10.54       C compiler or Python headers are not installed on this system. Try to run:
#21 10.54       sudo apt-get install gcc python3-dev
#21 10.54       error: command 'aarch64-linux-gnu-gcc' failed: No such file or directory
#21 10.54       [end of output]
#21 10.54   
#21 10.54   note: This error originates from a subprocess, and is likely not a problem with pip.
#21 10.54   ERROR: Failed building wheel for psutil
#21 10.54 Successfully built pyln-testing
#21 10.54 Failed to build psutil
#21 10.55 ERROR: Could not build wheels for psutil, which is required to install pyproject.toml-based projects
------
executor failed running [/bin/sh -c pip3 install /usr/local/src/lightning/contrib/pyln-testing]: exit code: 1

chrisguida avatar Mar 22 '23 00:03 chrisguida

Thanks for the description, looking into this

joelklabo avatar Mar 22 '23 20:03 joelklabo

Just needs build-essential, pkg-config, and python3-dev.

However, I'd love it if we could remove the dependency on python3-dev as this causes the container to balloon to a huge size.

chrisguida avatar Mar 22 '23 22:03 chrisguida

Resulting image is 1.22GB if fixed with the above packages. Would love to slim this down to ~5-10% of that size.

chrisguida avatar Mar 23 '23 02:03 chrisguida