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

相关推荐
爱喝水的鱼丶4 分钟前
SAP-ABAP:ABAP 用户出口参数传递与上下文获取:SAP 标准数据读取与交互逻辑实现
运维·性能优化·交互·sap·abap·经验交流·出口
IT大白鼠5 分钟前
PentestGPT作为AI运维编排工作流自动化底座的技术架构与应用价值评估
运维·人工智能·自动化·pentestgpt
浪兎兎42 分钟前
【Kubernetes 实战】(二)部署 Ruoyi-Cloud —— 部署服务
云原生·容器·kubernetes
j7~1 小时前
【Git】《Git 系列指南(二):Git基本操作与 reset 三种模式》
运维·git·git安装·git基本操作·git配置·创建git仓库·git reset三种模式
zzzll11111 小时前
n8n 工作流自动化平台入门指南
运维·自动化
Hrain-AI1 小时前
Anthropic oncall-kit 开源拆解:运维 Agent 落地范式的四基石与权限边界
运维·人工智能·开源
淼澄研学1 小时前
Proliferate开源框架技术解析与Docker部署实操
docker·容器·开源
HXDGCL1 小时前
从“转盘困局”到“直线破局”:华创力科技PTS精密分度输送系统如何重塑自动化产线
运维·科技·自动化
戴西软件2 小时前
国内有哪些智能化RPA工具?——从“录数据”到“做判断”,国产数字员工正在重新定义自动化
运维·自动化·rpa
浪兎兎2 小时前
Docker 容器技术笔记
笔记·docker·容器