#ubuntu容器
Ubuntu 容器可以用来快速获得一个带浏览器或桌面的临时 Linux 环境,适合测试网页、临时访问内网或隔离运行一些工具。
#新版 Ubuntu 容器
Tip
网页使用 3000 端口,必须使用 HTTPS。
setup.sh
#!/bin/bash
name=webtop-ubuntu
docker rm -f ${name}
docker run -d \
--name=${name} \
--security-opt seccomp=unconfined \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Asia/Shanghai \
--shm-size="1gb" \
--network=host \
--restart=always \
-e SUBFOLDER=/ \
-e TITLE=Webtop \
-e CUSTOM_USER=user \
-e PASSWORD=password \
-v ./data:/config \
-v /var/run/docker.sock:/var/run/docker.sock \
lscr.io/linuxserver/webtop:ubuntu-kde#旧版 Ubuntu 容器
Tip
网页使用 6080 端口。
docker-compose.yaml
version: '3.5'
services:
ubuntu-xfce-vnc:
container_name: xfce
image: imlala/ubuntu-xfce-vnc-novnc:latest
shm_size: "1gb"
ports:
- 5900:5900
- 6080:6080
environment:
- VNC_PASSWD=imlala
- GEOMETRY=1280x720
- DEPTH=32
volumes:
- ./Downloads:/root/Downloads
- ./Documents:/root/Documents
- ./Pictures:/root/Pictures
- ./Videos:/root/Videos
- ./Music:/root/Music
restart: unless-stopped下面是自定义打包版本,已经更新软件源、安装 Firefox,并调整了时区。
Dockerfile
FROM imlala/ubuntu-xfce-vnc-novnc
RUN sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list && \
apt-get update && \
apt-get upgrade -y --fix-missing && \
apt-get install firefox -y
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezonedocker-compose.yaml
version: '3.5'
services:
ubuntu-xfce-vnc:
container_name: xfce
image: registry.cn-hangzhou.aliyuncs.com/buyfakett/ubuntu-novnc
shm_size: "1gb"
ports:
- 5900:5900
- 6080:6080
environment:
- VNC_PASSWD=imlala
- GEOMETRY=1280x720
- DEPTH=32
volumes:
- ./Downloads:/root/Downloads
- ./Documents:/root/Documents
- ./Pictures:/root/Pictures
- ./Videos:/root/Videos
- ./Music:/root/Music
restart: unless-stopped