Plugins/docker failing while installing pynacl

This Dockerfile fails in drone . I can build it locally with no problem… Any idea what is going on?
Upgrading to version 3.9-alpine doesn’t help.

FROM python:3.8-alpine  AS builder
RUN apk update && apk upgrade && \
    apk add \
        bash \
        build-base \
        gcc \
        musl-dev \
        cargo \
        libffi-dev \
        libjpeg-turbo-dev \
        libressl-dev \
        libxslt-dev \
        libwebp-dev \
        linux-headers \
        postgresql-dev \
        zlib-dev \
        libc-dev \
        openssl-dev \
        make \
        curl \
        git
RUN pip install pynacl
[...]

It fails with:

Step 11/34 : RUN pip install pynacl
224	 ---> Running in 447e38ec2a0b
225	Collecting pynacl
226	  Downloading PyNaCl-1.4.0.tar.gz (3.4 MB)
227	  Installing build dependencies: started
228	  Installing build dependencies: finished with status 'done'
229	  Getting requirements to build wheel: started
230	  Getting requirements to build wheel: finished with status 'done'
231	    Preparing wheel metadata: started
232	    Preparing wheel metadata: finished with status 'done'
233	Collecting six
234	  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
235	Collecting cffi>=1.4.1
236	  Using cached cffi-1.14.6-cp38-cp38-linux_x86_64.whl
237	Collecting pycparser
238	  Using cached pycparser-2.20-py2.py3-none-any.whl (112 kB)
239	Building wheels for collected packages: pynacl
240	  Building wheel for pynacl (PEP 517): started
241	  Building wheel for pynacl (PEP 517): finished with status 'error'
242	  ERROR: Command errored out with exit status 1:
243	   command: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp0q8tuuwa
244	       cwd: /tmp/pip-install-8afql_7r/pynacl_7712f3ccc97a48f693a0a3e552c16ae1
[...]
  make: /bin/sh: Operation not permitted
525	  make: *** [Makefile:514: all-recursive] Error 127
526	  Traceback (most recent call last):
527	    File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
528	      main()
529	    File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
530	      json_out['return_val'] = hook(**hook_input['kwargs'])
531	    File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 248, in build_wheel
532	      return _build_backend().build_wheel(wheel_directory, config_settings,
533	    File "/tmp/pip-build-env-oku81f5p/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 221, in build_wheel
534	      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
535	    File "/tmp/pip-build-env-oku81f5p/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 207, in _build_with_temp_dir
536	      self.run_setup()
537	    File "/tmp/pip-build-env-oku81f5p/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 150, in run_setup
538	      exec(compile(code, __file__, 'exec'), locals())
539	    File "setup.py", line 216, in <module>
540	      setup(
541	    File "/tmp/pip-build-env-oku81f5p/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
542	      return distutils.core.setup(**attrs)
543	    File "/usr/local/lib/python3.8/distutils/core.py", line 148, in setup
544	      dist.run_commands()
545	    File "/usr/local/lib/python3.8/distutils/dist.py", line 966, in run_commands
546	      self.run_command(cmd)
547	    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
548	      cmd_obj.run()
549	    File "/tmp/pip-build-env-oku81f5p/overlay/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 299, in run
550	      self.run_command('build')
551	    File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
552	      self.distribution.run_command(command)
553	    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
554	      cmd_obj.run()
555	    File "/usr/local/lib/python3.8/distutils/command/build.py", line 135, in run
556	      self.run_command(cmd_name)
557	    File "/usr/local/lib/python3.8/distutils/cmd.py", line 313, in run_command
558	      self.distribution.run_command(command)
559	    File "/usr/local/lib/python3.8/distutils/dist.py", line 985, in run_command
560	      cmd_obj.run()
561	    File "setup.py", line 184, in run
562	      subprocess.check_call(["make"] + make_args, cwd=build_temp)
563	    File "/usr/local/lib/python3.8/subprocess.py", line 364, in check_call
564	      raise CalledProcessError(retcode, cmd)
565	  subprocess.CalledProcessError: Command '['make']' returned non-zero exit status 2.
566	  ----------------------------------------
567	  ERROR: Failed building wheel for pynacl
568	Failed to build pynacl
569	ERROR: Could not build wheels for pynacl which use PEP 517 and cannot be installed directly
570	The command '/bin/sh -c pip install pynacl' returned a non-zero code: 1
571	time="2021-08-22T02:08:19Z" level=fatal msg="exit status 1"
1 Like

Hi!
Any ideas about what happens here? Having the same error.