How to open Ubuntu GUI inside Docker image

I uploaded an Ubuntu image to Docker on Windows.

I can run Ubuntu:

docker run -it ubuntu

I see only root, but I do not see the Ubuntu GUI. How to install or configure a graphical interface for this image and run applications on this graphical interface, how do we work in a virtual machine?

+16
source share
3 answers

Typically, a development approach using Docker is to support an IDE on a workstation and create images from a binary file created from sources.

( , Docker) Domeide.imtqy.com/(Docker IDE!)
: Docker Tools for VisualStudio Docker.

https://microsoftcloudexplorer.gallerycdn.vsassets.io/extensions/microsoftcloudexplorer/visualstudiotoolsfordocker-preview/0.41.0/1478598789732/205468/1/add-docker-support.png

( Visual Studio 2015, Visual Studio Code.)

+6

fcwu/docker-ubuntu-vnc-desktop

https://github.com/fcwu/docker-ubuntu-vnc-desktop   :

docker run --name ubvnc -p 6080:80 -p 5900:5900 dorowu/ubuntu-desktop-lxde-vnc:bionic

:

  • : http://127.0.0.1:6080/#/, noVNC VNC JavaScript

  • :

    sudo apt-get install tigervnc-viewer
    xtigervncviewer :5900
    

    vinagre ,

    . vinagre, Firefox YouTube .

enter image description here

, docker .

docker start ubvnc

VNC. , :

docker stop ubvnc

, VNC- , .

. , , :

Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

Firefox .

: . --device /dev/snd :

:

Ubuntu 19.04, fcwu/docker-ubuntu-vnc-desktop, dorowu/ubuntu-desktop-lxde-vnc id : 70516b87e92d.

+3

You can directly connect the Docker container to your X server.

See the question. Q. Can you run GUI applications in a Docker container? .

+1
source

Source: https://habr.com/ru/post/1661074/


All Articles