Dockerfile and tkinter

Hello,
I am new to the forum. I searched for the tkinter topic but I could not find any. Would members of the forum help me out? I created a docker image with my tkinter app. However, when I tried to run my image, I keep receiving this error message
Traceback (most recent call last):
File “./aar.py”, line 19, in
aarWin = tk.Tk()
File “/usr/local/lib/python3.8/tkinter/init.py”, line 2261, in init
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

here is my Dockerfile
FROM python:3
ADD aar.py /
CMD [ “python”, “./aar.py”]

I searched stackoverflow; it seems tkinter does not work in a container. Any suggestion is greatly appreciated!!

Regards

Hello,
I’m using python 3.7 as the environment in the docker container. But I end up with error’s like

My command:- docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix face2
Error
Traceback (most recent call last):
File “main.py”, line 89, in
root = Tk()
File “/usr/local/lib/python3.7/tkinter/init.py”, line 2023, in init
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn’t connect to display “$DISPLAY”

Can anyone please post a solution to this and I’m new to this docker started 1 week ago. I searched for solution but I did’nt understand anything.