question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fails to build docker container

See original GitHub issue

Steps to reproduce

  1. Attempt to create any docker container with the given requirements.txt
  2. Load Python3 requirements in before_script
before_script:
  - pip3 install -r requirements.txt

requirements.txt

flake8==3.7.9
sqreen==1.17.1
yagmail==0.11.224

Expected behavior

Dependencies are installed successfully.

Actual behavior

386 Installing collected packages: entrypoints, pyflakes, mccabe, pycodestyle, flake8, py-mini-racer, sq-native, sqreen, yagmail
387     Running setup.py install for py-mini-racer: started
388     Running setup.py install for py-mini-racer: finished with status 'error'
389     ERROR: Command errored out with exit status 1:
390      command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-930p24mh/py-mini-racer/setup.py'"'"'; __file__='"'"'/tmp/pip-install-930p24mh/py-mini-racer/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-svmr4a41/install-record.txt --single-version-externally-managed --compile --home=/tmp/pip-target-ofk9bhjl
391          cwd: /tmp/pip-install-930p24mh/py-mini-racer/
392     Complete output (104 lines):
393     running install
394     running build
395     running build_py
396     creating build
397     creating build/lib.linux-x86_64-3.8
398     creating build/lib.linux-x86_64-3.8/py_mini_racer
399     copying py_mini_racer/__init__.py -> build/lib.linux-x86_64-3.8/py_mini_racer
400     copying py_mini_racer/py_mini_racer.py -> build/lib.linux-x86_64-3.8/py_mini_racer
401     creating build/lib.linux-x86_64-3.8/py_mini_racer/extension
402     copying py_mini_racer/extension/__init__.py -> build/lib.linux-x86_64-3.8/py_mini_racer/extension
403     copying py_mini_racer/extension/v8_build.py -> build/lib.linux-x86_64-3.8/py_mini_racer/extension
404     running egg_info
405     writing py_mini_racer.egg-info/PKG-INFO
406     writing dependency_links to py_mini_racer.egg-info/dependency_links.txt
407     writing top-level names to py_mini_racer.egg-info/top_level.txt
408     reading manifest file 'py_mini_racer.egg-info/SOURCES.txt'
409     reading manifest template 'MANIFEST.in'
410     warning: no previously-included files matching '__pycache__' found under directory '*'
411     warning: no previously-included files matching '*.py[co]' found under directory '*'
412     writing manifest file 'py_mini_racer.egg-info/SOURCES.txt'
413     copying py_mini_racer/extension/mini_racer_extension.cc -> build/lib.linux-x86_64-3.8/py_mini_racer/extension
414     running build_ext
415     running build_v8
416     cloning depot tools submodule
417     Traceback (most recent call last):
418       File "/tmp/pip-install-930p24mh/py-mini-racer/setup.py", line 161, in build_extension
419         self.run_command('build_v8')
420       File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
421         self.distribution.run_command(command)
422       File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
423         cmd_obj.run()
424       File "/tmp/pip-install-930p24mh/py-mini-racer/setup.py", line 203, in run
425         check_call(['git', 'init'])
426       File "/usr/local/lib/python3.8/subprocess.py", line 359, in check_call
427         retcode = call(*popenargs, **kwargs)
428       File "/usr/local/lib/python3.8/subprocess.py", line 340, in call
429         with Popen(*popenargs, **kwargs) as p:
430       File "/usr/local/lib/python3.8/subprocess.py", line 854, in __init__
431         self._execute_child(args, executable, preexec_fn, close_fds,
432       File "/usr/local/lib/python3.8/subprocess.py", line 1702, in _execute_child
433         raise child_exception_type(errno_num, err_msg, err_filename)
434     FileNotFoundError: [Errno 2] No such file or directory: 'git'
435     Traceback (most recent call last):
436       File "/tmp/pip-install-930p24mh/py-mini-racer/setup.py", line 161, in build_extension
437         self.run_command('build_v8')
438       File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
439         self.distribution.run_command(command)
440       File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
441         cmd_obj.run()
442       File "/tmp/pip-install-930p24mh/py-mini-racer/setup.py", line 203, in run
443         check_call(['git', 'init'])
444       File "/usr/local/lib/python3.8/subprocess.py", line 359, in check_call
445         retcode = call(*popenargs, **kwargs)
446       File "/usr/local/lib/python3.8/subprocess.py", line 340, in call
447         with Popen(*popenargs, **kwargs) as p:
448       File "/usr/local/lib/python3.8/subprocess.py", line 854, in __init__
449         self._execute_child(args, executable, preexec_fn, close_fds,
450       File "/usr/local/lib/python3.8/subprocess.py", line 1702, in _execute_child
451         raise child_exception_type(errno_num, err_msg, err_filename)
452     FileNotFoundError: [Errno 2] No such file or directory: 'git'
453     
454     During handling of the above exception, another exception occurred:
455     
456     Traceback (most recent call last):
457       File "<string>", line 1, in <module>
458       File "/tmp/pip-install-930p24mh/py-mini-racer/setup.py", line 212, in <module>
459         setup(
460       File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
461         return distutils.core.setup(**attrs)
462       File "/usr/local/lib/python3.8/distutils/core.py", line 148, in setup
463         dist.run_commands()
464       File "/usr/local/lib/python3.8/distutils/dist.py", line 966, in run_commands
465         self.run_command(cmd)
466       File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
467         cmd_obj.run()
468       File "/usr/local/lib/python3.8/site-packages/setuptools/command/install.py", line 61, in run
469         return orig.install.run(self)
470       File "/usr/local/lib/python3.8/distutils/command/install.py", line 545, in run
471         self.run_command('build')
472       File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
473         self.distribution.run_command(command)
474       File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
475         cmd_obj.run()
476       File "/usr/local/lib/python3.8/distutils/command/build.py", line 135, in run
477         self.run_command(cmd_name)
478       File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
479         self.distribution.run_command(command)
480       File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
481         cmd_obj.run()
482       File "/usr/local/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
483         _build_ext.run(self)
484       File "/usr/local/lib/python3.8/distutils/command/build_ext.py", line 340, in run
485         self.build_extensions()
486       File "/usr/local/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions
487         self._build_extensions_serial()
488       File "/usr/local/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial
489         self.build_extension(ext)
490       File "/tmp/pip-install-930p24mh/py-mini-racer/setup.py", line 180, in build_extension
491         raise Exception(err_msg % repr(e))
492     Exception: py_mini_racer failed to build, ensure you have an up-to-date pip (>= 8.1) to use the wheel instead
493                 To update pip: 'pip install -U pip'
494                 See also: https://github.com/sqreen/PyMiniRacer#binary-builds-availability
495     
496                 Original error: FileNotFoundError(2, 'No such file or directory')
497     ----------------------------------------
498 ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-930p24mh/py-mini-racer/setup.py'"'"'; __file__='"'"'/tmp/pip-install-930p24mh/py-mini-racer/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-svmr4a41/install-record.txt --single-version-externally-managed --compile --home=/tmp/pip-target-ofk9bhjl Check the logs for full command output.
499 The command '/bin/sh -c pip install -r requirements.txt --target=/home/app/python' returned a non-zero code: 1

System configuration

Whatever version sqreen==1.17.1 pulls in.

Python version: python:3-alpine (from docker)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
nizoxcommented, Jan 10, 2020

There are special installation instructions for Alpine Linux. In fact, Alpine is not a manylinux distribution and requires dedicated wheel builds.

You should be able to install it using:

$ apk add libgcc
$ pip install --index-url https://download.sqreen.io/python/alpine py-mini-racer
0reactions
alexpdrcommented, Jan 16, 2020

Using the special version for Alpine solved the problems! Issue can be closed 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to debug build failures - Docker Community Forums
I've written a guide on how to debug docker builds like that. In short, look at the container ID of the failed step,...
Read more >
Docker : image build failed - Stack Overflow
Paths in a Dockerfile are always relative to the the context directory. The context directory is the positional argument passed to docker ......
Read more >
An error occurred while attempting to build Docker image #3884
Given that I only just upgraded to Windows 1903 hours ago and now all docker builds fail with: hcsshim::PrepareLayer failed in Win32: Incorrect ......
Read more >
SOLVED: Docker build “Could not resolve 'archive.ubuntu ...
SOLVED: Docker build “Could not resolve 'archive.ubuntu.com'” apt-get fails to install anything. I was configuring Apache server using an ubuntu:latest image ...
Read more >
Failure when build docker image - PyTorch Forums
Are you seeing any errors in the build log file? The current error is only explaining that the docker container build failed due...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found