StackStorm / st2packs-dockerfiles

Source for st2packs-builder and st2packs-runner images
3 stars 20 forks source link

Getting error when building custom image with 'ansible' pack added. #31

Open dhexnatheo opened 2 years ago

dhexnatheo commented 2 years ago
Building wheels for collected packages: pykerberos
  Building wheel for pykerberos (setup.py): started
  Building wheel for pykerberos (setup.py): finished with status 'error'
  Running setup.py clean for pykerberos
Failed to build pykerberos
Installing collected packages: pycparser, urllib3, idna, charset-normalizer, cffi, certifi, requests, pyparsing, ntlm-auth, MarkupSafe, cryptography, xmltodict, resolvelib, requests-ntlm, PyYAML, pyspnego, packaging, jinja2, requests-credssp, pywinrm, pykerberos, ansible-core, netaddr, ansible
    Running setup.py install for pykerberos: started
    Running setup.py install for pykerberos: finished with status 'error'
 (stderr:   ERROR: Command errored out with exit status 1:
   command: /opt/stackstorm/virtualenvs/ansible/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-iyp_di66
       cwd: /tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/
  Complete output (10 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'kerberos' extension
  creating build
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/src
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/opt/stackstorm/virtualenvs/ansible/include -I/usr/include/python3.8 -c src/kerberos.c -o build/temp.linux-x86_64-3.8/src/kerberos.o
  unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pykerberos
    ERROR: Command errored out with exit status 1:
     command: /opt/stackstorm/virtualenvs/ansible/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-uqi43b55/install-record.txt --single-version-externally-managed --compile --install-headers /opt/stackstorm/virtualenvs/ansible/include/site/python3.8/pykerberos
         cwd: /tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/
    Complete output (10 lines):
    running install
    running build
    running build_ext
    building 'kerberos' extension
    creating build
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/src
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/opt/stackstorm/virtualenvs/ansible/include -I/usr/include/python3.8 -c src/kerberos.c -o build/temp.linux-x86_64-3.8/src/kerberos.o
    unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/stackstorm/virtualenvs/ansible/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g2tgpfz4/pykerberos_8b76ed6ecc4c44fa8b5baef50282d2d6/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-uqi43b55/install-record.txt --single-version-externally-managed --compile --install-headers /opt/stackstorm/virtualenvs/ansible/include/site/python3.8/pykerberos Check the logs for full command output.
arm4b commented 2 years ago

@FreddyAprilliant Thanks for sharing! :+1:

I'd recommend considering the Dockerfile for building your packs as an infrastructure-as-code artifact, keep it in the repo so you can just do default docker build anytime without specifying the CLI parameters:

Dockerfile:

# list of packs to be installed
ARG PACKS="ansible"

FROM stackstorm/st2packs:builder AS builder
# custom dependencies
RUN apt update && apt install -y libkrb5-dev gcc python3-dev python-dev

RUN /opt/stackstorm/st2/bin/st2-pack-install ${PACKS}
FROM stackstorm/st2packs:runtime

that'll technically do the same. Choose the approach suitable for situation.