Installing a package (let's show how to install python):
apk add python3 py3-pip
Specific version of a package (python or others).
- Go to Alpine Packages;
- Search for your specific version using filters (e.g. "python3");
- Open the package page with the right architecture;
- Look for the "version" field (which is composed by a number and a suffix; e.g.
3.8.6-r0); - Launch this command:
apk add python3<3.8.6-r0
apk add py3-pip
It will install the last useful pip for your python version.
Using = and using < make no difference.
The procedure is equivalent for every Alpine package.
apk add curl
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
Others in the comments.
apk add --no-cache python3 py3-pip
It allows users to install packages with an index that is updated and used on-the-fly and not cached locally:
FROM gliderlabs/alpine:3.3
RUN apk --no-cache add nginx
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
This avoids the need to use
--update-cacheandremove /var/cache/apk/*when done installing packages.
sudo