Attempting to run gnome-terminal inside a Docker container fails (Failed to execute child process “dbus-launch” (No such file or directory))

Attempting to run gnome-terminal inside a Docker container gives the following error

# gnome-terminal -e "python3 test.py"
# Option “-e” is deprecated and might be removed in a later version of gnome-terminal.
# Use “-- ” to terminate the options and put the command line to execute after it.
# Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Failed to execute child process “dbus-launch” (No such file or directory)

Install dbus-x11 to solve

sudo apt-get install -y dbus-x11

If you don't have gnome-terminal, you can install it below

sudo apt-get install -y gnome-terminal

reference

simple interprocess messaging system (X11 deps)

Recommended Posts

Attempting to run gnome-terminal inside a Docker container fails (Failed to execute child process “dbus-launch” (No such file or directory))
PG :: ConnectionBad: could not connect to server: No such file or directory
When dealing with whenever in Docker No such file or directory --crontab
I made a Docker container to run Maven
No such file or directory @ rb_sysopen --Error like public/user_images/1.jpg
No such file or directory @ rb_sysopen-/Users/○○/Gemfile.lock (Errno :: ENOENT) suffered