尧图网站建设 尧图网络
  • 首页
  • 关于我们
  • 服务项目
  • 案例展示
  • 建站流程
  • 资讯中心
  • 联系我们
首页/资讯中心/详情

Docker - ZZH Ubuntu Image - Desktop

Docker - ZZH Ubuntu Image - Desktop
📅 发布时间:2026/6/20 21:07:53
Docker - ZZH Ubuntu Image - Desktop

Here’s the final all-in-one Dockerfile for your ubuntu-zzh-vnc container, ready to build and run on Windows. It includes:

  • XFCE desktop (lightweight)

  • zsh + Oh My Zsh with agnoster theme

  • Common dev tools: vim, htop, python3, pip, nodejs, npm

  • VNC server with clipboard sharing

  • Persistent home folder (/home/zzh)

  • Non-root user zzh

  • UTF-8 locale


Final Dockerfile

FROM ubuntu:24.04ENV DEBIAN_FRONTEND=noninteractive# Install base packages, dev tools, XFCE, and VNC
RUN apt-get update && apt-get install -y \sudo \zsh \curl \git \nano \locales \vim \htop \python3 \python3-pip \nodejs \npm \xfce4 xfce4-terminal \thunar \tigervnc-standalone-server \tigervnc-common \&& rm -rf /var/lib/apt/lists/*# Set UTF-8 locale
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8# Create non-root user 'zzh' with zsh shell
RUN useradd -ms /bin/zsh zzh \&& usermod -aG sudo zzhUSER zzh
WORKDIR /home/zzh# Install Oh My Zsh and set theme + aliases
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended \&& sed -i 's/ZSH_THEME=".*"/ZSH_THEME="agnoster"/' ~/.zshrc \&& echo 'alias ll="ls -alF"' >> ~/.zshrc \&& echo 'alias la="ls -A"' >> ~/.zshrc \&& echo 'alias l="ls -CF"' >> ~/.zshrc# Setup VNC password and persistent configuration
RUN mkdir -p /home/zzh/.vnc \&& echo "1234" | vncpasswd -f > /home/zzh/.vnc/passwd \&& chmod 600 /home/zzh/.vnc/passwd# Persistent VNC startup script
RUN echo "#!/bin/bash\nexport USER=zzh\nexport HOME=/home/zzh\nvncserver :1 -geometry 1280x800 -fg -localhost no -SecurityTypes VncAuth\n" \> /home/zzh/startvnc.sh \&& chmod +x /home/zzh/startvnc.sh# Expose VNC port
EXPOSE 5901# Default shell
SHELL ["/bin/zsh", "-c"]# Start VNC as non-root user on container start
CMD ["/home/zzh/startvnc.sh"]

 

🔧 Build & Run

  1. Build the image:

 
docker build -t ubuntu-zzh-vnc .

 

  1. Run the container with persistent home:

docker run -d -p 5901:5901 --name ZUBT \-v D:/Docker/Volumes/ZUBT/home/zzh:/home/zzh \ubuntu-zzh-vnc

 

  1. Connect from Windows using a VNC client (TigerVNC Viewer):

  • Server: localhost:5901

  • Password: 1234

  1. Optional: Exec into container shell anytime:

docker exec -it ZUBT zsh

 

You’ll be logged in as zzh with zsh + Oh My Zsh ready.


✅ Features now:

  • XFCE GUI accessible via VNC

  • Persistent home folder mapped to Windows

  • zsh + Oh My Zsh with theme and aliases

  • Common dev tools installed

  • Clipboard sharing enabled via VNC

  • Non-root user by default

 

Here’s a ready-to-use docker-compose.yml for your ubuntu-zzh-vnc container. This will handle the image build, persistent volume, and port mapping, so you can start everything with one command.


docker-compose.yml

version: "3.9"services:ubuntu-vnc:build:context: .       # folder where your Dockerfile isdockerfile: Dockerfileimage: ubuntu-zzh-vnccontainer_name: ZUBTtty: truestdin_open: trueports:- "5901:5901"    # VNC server portvolumes:- D:/Docker/Volumes/ZUBT/home/zzh:/home/zzh  # persistent home folder

 


🔧 Usage

  1. Make sure your Dockerfile and docker-compose.yml are in the same folder.

  2. Build and start the container:

docker compose up -d --build

 

  1. Connect via VNC (TigerVNC Viewer):

  • Server: localhost:5901

  • Password: 1234

  1. Exec into the container shell if needed:

docker exec -it ZUBT zsh

 

  1. Stop the container:

docker compose down

 

 

相关新闻

  • 图解17:5中网络IO模型
  • 【session反序列化】 - 指南
  • 在k8s集群中解决master节点与node通信

最新新闻

  • 2026年5月美国零售销售月率超预期
  • nuScenes数据集实战指南(一)——环境配置与数据初探
  • 2026合肥十大叛逆戒网瘾学校排名|央视推荐+真实案例,家长必看避坑指南 - 辛云教育资讯
  • 嵌入式GUI性能调优:emWin诊断三板斧与API调试实战
  • 松鼠软件管家
  • 刑事合规律师事务所:企业如何选型?三大评估维度与合规服务评测 - 品牌2026

日新闻

  • 信任的进化:技术实现详解——如何用JavaScript构建博弈论模拟器
  • Terrakube自定义工作流:如何集成OPA、Infracost等工具扩展IaC能力
  • grunt-concurrent快速入门:5分钟学会并行运行Grunt任务

周新闻

  • 3步解锁iOS设备:applera1n激活锁绕过完全指南
  • 39 2026 人工智能证书终极盘点,普通人选 AI 证书可以从这些方向入手
  • Redis 暴露公网有多危险?从端口检查到补救步骤

月新闻

  • 【总结】入门篇:50句话让你记住架构核心概念
  • WeChatMsg技术方案解析:实现Mac微信数据自主管理的完整解决方案
  • WeChatMsg:革新性微信数据备份方案,打造你的专属数字记忆库

关于尧图

  • 公司简介
  • 团队介绍
  • 企业文化
  • 荣誉资质

服务项目

  • 定制开发
  • 电商建站
  • UI 设计
  • 运维服务

快速链接

  • 案例展示
  • 建站流程
  • 常见问题
  • 资讯中心

联系方式

  • 📍北京市朝阳区互联网产业园 A 座 10 层
  • 📞400-888-8888
  • ✉️contact@rkmt.cn
  • 🕐周一至周日 9:00-21:00

© 2024 北京尧图网络科技有限公司 版权所有 | 京 ICP 备 XXXXXXXX 号