Docker与VNC的使用

https://hub.docker.com/r/dorowu/ubuntu-desktop-lxde-vnc

下载nvc

客户端
https://downloads.realvnc.com/download/file/viewer.files/VNC-Viewer-7.12.0-Windows.exe

服务端

bash 复制代码
docker pull dorowu/ubuntu-desktop-lxde-vnc

#下载成功
docker pull dorowu/ubuntu-desktop-lxde-vnc
Using default tag: latest
latest: Pulling from dorowu/ubuntu-desktop-lxde-vnc
Digest: sha256:775184eaa5bbc01bc4261a6c9596a642b3b43a433c1508637567bc724575964b
Status: Image is up to date for dorowu/ubuntu-desktop-lxde-vnc:latest
docker.io/dorowu/ubuntu-desktop-lxde-vnc:latest

#验证
docker images
REPOSITORY                       TAG       IMAGE ID       CREATED       SIZE
dorowu/ubuntu-desktop-lxde-vnc   latest    775184eaa5bb   4 years ago   1.92GB
启动
bash 复制代码
	docker run --rm --privileged -v /dev:/dev \
	--name ubuntu-desktop-lxde-vnc \
	-p 6080:80 \
	-p 5900:5900 \
	-e USER=much \
	-e PASSWORD=much \
	-e HTTP_PASSWORD=much \
	-e VNC_PASSWORD=much \
	-v ~/work:/home/much/work \
	-v ~/.gitconfig:/home/much/work/.gitconfig:ro \
	-e RESOLUTION=1280x720 \
	dorowu/ubuntu-desktop-lxde-vnc 


#用户不存在
docker exec --user much -it ubuntu-desktop-lxde-vnc /bin/bash
no users found

#连接成功
docker exec --user much -it ubuntu-desktop-lxde-vnc /bin/bash
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

much@6d5d859d8680:/root$ whoami
much	

#删除用户
sudo userdel -r much
# 选择工作空间 
docker exec  --user much -it  --workdir /home/much/work ubuntu-desktop-lxde-vnc  /bin/bash
连接


参考链接

https://blog.csdn.net/qq_20330595/article/details/139932582

https://blog.csdn.net/qq_20330595/article/details/134799908

相关推荐
甲鱼92942 分钟前
MySQL 实战手记:日志管理与主从复制搭建全指南
运维
fetasty1 天前
rustfs加picgo图床搭建
docker
蝎子莱莱爱打怪2 天前
GitLab CI/CD + Docker Registry + K8s 部署完整实战指南
后端·docker·kubernetes
碳基沙盒2 天前
OpenClaw 多 Agent 配置实战指南
运维
小p3 天前
docker学习7:docker 容器的通信方式
docker
小p3 天前
docker学习5:提升Dockerfile水平的5个技巧
docker
小p3 天前
docker学习3:docker是怎么实现的?
docker
小p4 天前
docker学习: 2. 构建镜像Dockerfile
docker
小p5 天前
docker学习: 1. docker基本使用
docker
蝎子莱莱爱打怪5 天前
Centos7中一键安装K8s集群以及Rancher安装记录
运维·后端·kubernetes