Warm tip: This article is reproduced from serverfault.com, please click

Problems having python installed in Docker container for GUI software

发布于 2021-09-09 17:08:59

I would like to install This software called Brat on my Ubuntu-based machine except that Brat requires Debian and I didn't manage to install it on Ubuntu. I thought I could go through a Docker container, for that, I wrote the following Dockerfile where I included the necessary libraries for the software

FROM debian:8
WORKDIR /home
COPY . /home

RUN apt-get update && apt install -y curl libgdal-dev libspatialindex-dev libxerces-c-dev \
    libxrandr-dev xsdcxx libegl1-mesa libproj-dev libgeos-c1\
    rsync libsm6 libglu1 libqt5x11extras5 

RUN chmod +x brat-4.2.0-x86_64-installer.run

I built an image based on the Dockerfile and then I installed the software manually (because it contains yes/no questions) inside a Docker container (created from the built image) using: ./brat-4.2.0-x86_64-installer.run. I committed the image and launched the software form my localhost terminal using the following command docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix new_brat_debian /usr/local/bin/brat where new_brat_debian is the name of the committed image. The software was launched successfully and the GUI window appeared except that I had an error asking for the Numpy library to be installed so that the software could function properly. I tried installing Python3 on Debian and followed every way I could find but without success. At this point I don't know how to fix this issue, I thought about doing docker multi-stage building with new_brat_debian and a Python-built image but I don't know if it's worth the adventure. Does anyone have an idea or a suggestion on how to include Python in the existing Docker image? Many thanks in advance.

Questioner
mja
Viewed
0
Prithvi Singh 2021-09-10 18:19:13

Try with latest debian

FROM debian:latest

It's installing python 3.4 and numpy gives error that it requires more than 3.7.

Or

Following worked

FROM debian:8

RUN apt-get update && apt-get -y upgrade

RUN apt-get install -y apt-utils python3 python3-pip python3-numpy

RUN pip3 -V

RUN pip3 show numpy