Код: Выделить всё
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
RUN pip install tk
RUN /usr/bin/dnf install tk-devel #This one
COPY . .
CMD ["python", "PMUID.py"]
Код: Выделить всё
stroop@fedora-d:~/PMUID$ docker run -it --rm pmuid-app
Traceback (most recent call last):
File "/app/PMUID.py", line 4, in
import tkinter as tk
File "/usr/local/lib/python3.10/tkinter/__init__.py", line 37, in
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
Код: Выделить всё
stroop@fedora-d:~/PMUID$ docker build -t pmuid-app .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/buildx/
Sending build context to Docker daemon 434.9MB
Step 1/8 : FROM python:3.10-slim
---> 5f42e6b8b17e
Step 2/8 : WORKDIR /app
---> Using cache
---> d8334c6d0fe9
Step 3/8 : COPY requirements.txt .
---> Using cache
---> 727d1fc33b7f
Step 4/8 : RUN pip install -r requirements.txt
---> Using cache
---> fed50ddeedcd
Step 5/8 : RUN pip install tk
---> Using cache
---> 3dd74195c49d
Step 6/8 : RUN /usr/bin/dnf install tk-devel
---> Running in f3d680db3777
/bin/sh: 1: /usr/bin/dnf: not found
The command '/bin/sh -c /usr/bin/dnf install tk-devel' returned a non-zero code: 127
Подробнее здесь: https://stackoverflow.com/questions/787 ... -not-found