第 5 節

The graphical interface of the program inside the Docker container cannot be displayed.

0瀏覽次數0訪問次數--跳出率--平均停留

(After you have successfully created the container, come back to perform this operation.)

Temporarily allow X11 access: Run the following command on the host machine each time you boot to allow X11 access: (But running the command every time you boot is cumbersome. You can write it as a script that starts automatically at boot. See Auto-start Applications and Scripts for details.)

I don't see any Simplified Chinese Markdown fragment in your message. Could you please provide the text you'd like me to translate?

xhost +local:docker

The auto-start script is as follows:

#!/bin/bash
# 等待 X Server 就绪(最多等 10 秒)
for i in {1..10}; do
    if [ -n "$DISPLAY" ] && xset q >/dev/null 2>&1; then
        /usr/bin/xhost +local:docker
        exit 0
    fi
    sleep 1
done

Here is the tutorial section:

音乐页