Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Alpine Linux python (missing)

Tags:

docker

alpine

I have a pipeline which deploys my container from GitLab. Last deployment was 5 days ago and went without any problems. Today I deploy it and get the following error:

$ apk add --no-cache curl python py-pip  fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz  fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz  ERROR: unsatisfiable constraints:    python (missing):      required by: world[python] 

My job definition is:

my-deploy:   type: my-deploy   image: docker:stable   script:     - apk update     - apk add --no-cache curl python py-pip <-- Here the erorr happens     ... 
like image 204
AGoranov Avatar asked Jun 03 '20 09:06

AGoranov


People also ask

Does alpine have Python?

For comparison purposes, the download size of python:3.10-slim-bullseye is 45MB, and python:3.10-alpine is 18MB. Their uncompressed on-disk sizes are 125MB and 48MB respectively.

Can you install Docker on alpine?

To install Docker on Alpine Linux, run apk add --update docker openrc. The Docker package is available in the Community repository. Therefore, if apk add fails because of unsatisfiable constraints error, you need to edit the /etc/apk/repositories file to add (or uncomment) a line.

Does Docker have Python?

Docker Hub contains a number of Python Official Images for use with your project.

Why is Alpine Linux used for Docker?

Alpine Linux is a Linux distribution built around musl libc and BusyBox. The image is only 5 MB in size and has access to a package repository that is much more complete than other BusyBox based images. This makes Alpine Linux a great image base for utilities and even production applications.

Should you use Alpine Linux for Docker images?

When you’re choosing a base image for your Docker image, Alpine Linux is often recommended. Using Alpine, you’re told, will make your images smaller and speed up your builds.

How to setup a Python development environment with Docker and Alpine Linux?

Setting up a Python Development Environment with Docker and Alpine Linux! Frist, download and install Docker Desktop in your computer. Once, you are done with that, you can follow the steps here to create a development environment! Note the first 3 letters of your alpine linux docker container.

Should you use Alpine Linux for Python?

Using Alpine, you’re told, will make your images smaller and speed up your builds. And if you’re using Go that’s reasonable advice. But if you’re using Python, Alpine Linux will quite often:

What is the purpose of the Python Docker image?

Just like the main python docker image, it creates useful symlinks that are expected to exist, e.g. python3.4 > python, pip2.7 > pip, etc.) Added testing and community repositories to Alpine's /etc/apk/repositories file


1 Answers

From this issue on the Docker's repo:

This was "broken" while updating our base from alpine:3.11 to alpine:3.12.

In order to fix it you need to specify the version of Python directly, e.g.:

apk add python2 // or apk add python3 
like image 55
AGoranov Avatar answered Oct 03 '22 00:10

AGoranov