Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@karma-git
Created January 13, 2022 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karma-git/40db40bdf90e85d8c22eefb4b65e6ffb to your computer and use it in GitHub Desktop.
Save karma-git/40db40bdf90e85d8c22eefb4b65e6ffb to your computer and use it in GitHub Desktop.
I hate cryptography

Overview

cryptography needed in many packages as dependency, but looks like it difficult to build (especialy in alpine)

According to docs:

❯ docker run -it alpine:3.14
/ # apk add python3 py3-pip
...
/ # apk add gcc musl-dev python3-dev libffi-dev openssl-dev cargo
...
/ # pip3 install cryptography
Collecting cryptography
  Downloading cryptography-36.0.1.tar.gz (572 kB)
     |████████████████████████████████| 572 kB 1.5 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting cffi>=1.12
  Using cached cffi-1.15.0.tar.gz (484 kB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Using legacy 'setup.py install' for cffi, since package 'wheel' is not installed.
Building wheels for collected packages: cryptography
  Building wheel for cryptography (PEP 517) ...
...

And here it glitches endlessly:

Better solution:

Compiled binary for alpine:

/ # apk add python3 py3-pip py3-cryptography && pip install poetry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment