(OK) VNCserver - GUI application - in Docker container

refer to: https://hub.docker.com/r/consol/centos-xfce-vnc



----------------------------------------------------
# step 1
---------------------------------------------------- begin
dnf remove docker
dnf install docker-io

rm /var/lib/docker/ -rf
ls /var/lib/docker/

systemctl start docker
systemctl stop docker
systemctl status docker
systemctl enable docker
---------------------------------------------------- end

----------------------------------------------------
# step 2
---------------------------------------------------- begin
https://hub.docker.com/r/consol/centos-xfce-vnc
----------------------------------------------------
docker search consol

docker pull docker.io/consol/centos-xfce-vnc
docker images
docker run --rm -it docker.io/consol/centos-xfce-vnc /bin/sh

mkdir /opt/tmp/paper-4-IRP_in_MANETs
docker ps
docker cp 19a534cf9ec8:/headless /opt/tmp/paper-4-IRP_in_MANETs
docker cp 19a534cf9ec8:/dockerstartup /opt/tmp/paper-4-IRP_in_MANETs

docker ps -a
docker rmi docker.io/consol/centos-xfce-vnc
docker rmi <IMAGE ID>
docker rm <CONTAINER ID>
---------------------------------------------------- end


----------------------------------------------------
# step 3
---------------------------------------------------- use
docker pull centos                    #// or  docker pull docker.io/centos
docker images
docker tag 36540f359ca3 ztguang/centos:7
# docker build -t ztguang/centos:vnc -f Dockerfile.el7

[root@bupt paper-4-IRP_in_MANETs]# cd /opt/share-vm/fedora23server-share/paper-4-IRP_in_MANETs
[root@bupt paper-4-IRP_in_MANETs]# gedit Dockerfile

mkdir /opt/share-vm/fedora23server-share/paper-4-IRP_in_MANETs/dockerfiles
cp -a /opt/tmp/paper-4-IRP_in_MANETs/* /opt/share-vm/fedora23server-share/paper-4-IRP_in_MANETs/dockerfiles
cd dockerfiles/headless/
rm .bashrc .chromium-browser.init .ICEauthority Desktop .local .vnc .xfce4-session.verbose-log .cache .config .gnupg .mozilla .pki .Xauthority -rf
cd -

docker build -t ztguang/centos-vnc .
docker images
docker tag 7f6e6b7d4b14 ztguang/centos:vnc

docker run --rm -it ztguang/centos:vnc /bin/sh
yum install tigervnc-server && yum clean all
# Saving the Image
docker ps -a
docker commit c94f639915bc centos:vnc

docker run --rm -it ztguang/centos:vnc /bin/sh

# vnc-client
172.17.0.2:5901
----------------------------------------------------


posted @ 2017-07-20 11:24  张同光  阅读(150)  评论(0编辑  收藏  举报