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

相关推荐
lThE ANDE3 小时前
最完整版Linux安装Redis(保姆教程)
linux·运维·redis
yyuuuzz6 小时前
企业出海:技术部署与运维避坑
运维
workflower7 小时前
人机交互部分OOD
运维·人工智能·自动化·集成测试·人机交互·软件需求
农村小镇哥7 小时前
nginx服务器的介绍
运维·服务器·nginx
小夏子_riotous7 小时前
Docker学习路径——3、常用命令
linux·运维·服务器·学习·docker·容器·centos
IMPYLH9 小时前
Linux 的 rm 命令
linux·运维·服务器·网络·bash
white-persist10 小时前
【vulhub shiro 漏洞复现】vulhub shiro CVE-2016-4437 Shiro反序列化漏洞复现详细分析解释
运维·服务器·网络·python·算法·安全·web安全
代码中介商11 小时前
手把手教你Linux 打包压缩与 gcc 编译详解
linux·运维·服务器·编译·打包·压缩
HYNuyoah11 小时前
docker 安装win10系统
运维·docker·容器
liulilittle12 小时前
Prompt for OpenCode + CodeX-5.3:多个重型任务交付给AI自动化完成
运维·自动化·prompt