Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tkinter install in docker

I have a docker file that installs all the dependencies and creates an environment for the application, but there is one particular one that is giving me a hard time.

I am using this command to install tkinter in docker container

RUN apt-get install -y python3-tk

But this one gives a prompt to select for time zones and geography.

I am currently circumventing this by getting in the docker and install the same in container with

docker run -ti tag:latest /bin/sh

which isn't very neat, is there a way around this one, Either to do one of the following

  1. Auto select the prompt (with something like expect and send)
  2. Install tkinter without prompt maybe defaults.

Any suggestions that are not complete answers for similar problems are appreciated as well, we can also install it in a different way if possible without apt

like image 355
Inder Avatar asked Aug 31 '25 20:08

Inder


1 Answers

I had the same problem, and I used this in my Dockerfile:

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/London
RUN apt-get install -y python3-tk

This is based on this answer: How to install tzdata on a ubuntu docker image?

like image 117
endavid Avatar answered Sep 04 '25 05:09

endavid