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

相关推荐
谁似人间西林客1 小时前
工厂大脑如何让汽车制造告别“救火式”运维?
运维·汽车·制造
飞飞传输2 小时前
数字化科研提速关键 构建安全可控一体化跨网数据传输体系
大数据·运维·安全
wanhengidc2 小时前
服务器中带宽的重要性
运维·服务器·网络·安全·web安全
java资料站3 小时前
常用中间件快速搭建
docker·中间件
云游牧者3 小时前
K8S故障排查三板斧-CSDN博客
运维·docker·云原生·kubernetes·k8s·容器化·故障排查
程序员老邢4 小时前
【技术底稿 32】Nginx 经典大坑复盘:本机公网域名自环代理,导致接口返回首页 / 404 实战排障
java·运维·nginx·前后端分离·技术底稿·后端部署
忧云4 小时前
开源 SSH 客户端 Netcatty:免费替代 Termius,带 AI 的现代化运维工具
运维·开源·ssh
想唱rap4 小时前
传输层协议TCP
linux·运维·服务器·网络·c++·tcp/ip
曦夜日长5 小时前
Linux系统篇,权限(二):缺省权限、最终权限的计算、文件隔离的两种方式
linux·运维·服务器