转到您的wifi信息并获取系统。例如,您的HOST IP使用192.168.1.1
ifconfig oripconfig和用户名,
whoami然后在容器中,您可以像
ssh user_name@192.168.1.1 'DISPLAY=:0 firefox http://192.168.1.1:8080'
适用于linux。
如果主机是窗口,则可以运行
ssh user_name@192.168.1.1 'DISPLAY=:0 start http://192.168.1.1:8080'
如果您想避免使用用户名和密码,则只需使用公钥-私钥,然后使用该密钥将您的公钥放入容器和ssh。
要么
docker exec -it container_name ash|bash -c ssh user_name@192.168.1.1'DISPLAY=:0 firefox http://192.168.1.1:8080'
您可以在os上运行不同的命令库
if [[ "$OSTYPE" == "linux-gnu" ]]; then # ...elif [[ "$OSTYPE" == "darwin"* ]]; then # Mac OSXelif [[ "$OSTYPE" == "cygwin" ]]; then # POSIX compatibility layer and Linux environment emulation for Windowselif [[ "$OSTYPE" == "msys" ]]; then # Lightweight shell and GNU utilities compiled for Windows (part of MinGW)elif [[ "$OSTYPE" == "win32" ]]; then # I'm not sure this can happen.elif [[ "$OSTYPE" == "freebsd"* ]]; then # ...else # Unknown.fi
https://support.rackspace.com/how-to/logging-in-with-an-ssh-private-key-on-
linuxmac/



