Docker

From miki
Revision as of 10:30, 27 June 2023 by Mip (talk | contribs) (→‎Install)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Links

Install

Examples:

Tips

Alpine - Install a specific package version

From SuperUser:

# Both are equal
apk add packagename=1.2.3-suffix
apk add 'packagename<1.2.3-suffix'

Install pip3

Installing python3-dev in Alpine we get the error pip3: not found

RUN apk add --no-cache python3 openssl ca-certificates git openssh sshpass
&& apk --update add --virtual build-dependencies python3-dev libffi-dev openssl-dev build-base
&& pip3 install --upgrade pip cffi
# ...
# Error:
# /bin/sh: pip3: not found
# ERROR: Job failed: exit code 127
  • The workaround is to add py-pip library.
  • Recommended solution [1] is to run apk add cmd:pip3, which will pull whatever package that provides pip3.

Don't use Alpine for Python build