feat!: migrate to archlinux

This commit is contained in:
DCsunset 2020-05-13 20:34:15 -07:00
parent fe97c557da
commit 9ba1dce00e
7 changed files with 35 additions and 87 deletions

View file

@ -1,34 +1,30 @@
ARG VERSION
FROM ubuntu:${VERSION:-latest}
FROM archlinux:${VERSION:-latest}
LABEL MAINTAINER="DCsunset"
ENV noVNC_version=1.1.0
ENV websockify_version=0.9.0
ENV tigervnc_version=1.10.1
# Local debug
#COPY ./sources.list /etc/apt/
#COPY ./websockify-${websockify_version}.tar.gz /websockify.tar.gz
#COPY ./noVNC-${noVNC_version}.tar.gz /noVNC.tar.gz
RUN echo "Server = https://mirrors.ustc.edu.cn/archlinux/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist
RUN echo "Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/\$repo/os/\$arch" >> /etc/pacman.d/mirrorlist
COPY ./websockify-${websockify_version}.tar.gz /websockify.tar.gz
COPY ./noVNC-${noVNC_version}.tar.gz /noVNC.tar.gz
# Install apps
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq xfce4 xfce4-goodies \
chromium-browser vim wget \
python3-numpy python3-setuptools \
&& rm -rf /var/lib/apt/lists/*
RUN pacman -Sy --noconfirm xfce4 xfce4-goodies \
chromium vim wget tigervnc \
python-numpy python-setuptools
# Install TigerVNC and noVNC
RUN wget "https://bintray.com/tigervnc/stable/download_file?file_path=tigervnc-${tigervnc_version}.x86_64.tar.gz" -O /tigervnc.tar.gz \
&& tar -xvf /tigervnc.tar.gz -C / \
&& rm /tigervnc.tar.gz \
&& wget https://github.com/novnc/websockify/archive/v${websockify_version}.tar.gz -O /websockify.tar.gz \
RUN pacman -Scc \
# Install noVNC
# && wget https://github.com/novnc/websockify/archive/v${websockify_version}.tar.gz -O /websockify.tar.gz \
&& tar -xvf /websockify.tar.gz -C / \
&& cd /websockify-${websockify_version} \
&& python3 setup.py install \
&& python setup.py install \
&& cd / && rm -r /websockify.tar.gz /websockify-${websockify_version} \
&& wget https://github.com/novnc/noVNC/archive/v${noVNC_version}.tar.gz -O /noVNC.tar.gz \
# && wget https://github.com/novnc/noVNC/archive/v${noVNC_version}.tar.gz -O /noVNC.tar.gz \
&& tar -xvf /noVNC.tar.gz -C / \
&& cd /noVNC-${noVNC_version} \
&& ln -s vnc.html index.html \

View file

@ -1,9 +1,9 @@
# docker-ubuntu-vnc
# docker-archlinux-vnc
[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/dcsunset/ubuntu-vnc)](https://hub.docker.com/r/dcsunset/ubuntu-vnc)
[![Docker Image Size](https://badgen.net/docker/size/dcsunset/ubuntu-vnc)](https://hub.docker.com/r/dcsunset/ubuntu-vnc)
[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/dcsunset/archlinux-vnc)](https://hub.docker.com/r/dcsunset/archlinux-vnc)
[![Docker Image Size](https://badgen.net/docker/size/dcsunset/archlinux-vnc)](https://hub.docker.com/r/dcsunset/archlinux-vnc)
A docker image of Ubuntu with Xfce desktop and VNC support.
A docker image of Arch Linux with Xfce desktop and VNC support.
## Screenshots
@ -11,20 +11,11 @@ A docker image of Ubuntu with Xfce desktop and VNC support.
![Figure 2](./screenshots/2.png)
## Tags
Different tags of this image are based on different versions of ubuntu.
Currently available tags:
* latest: based on ubuntu:lastest
* 18.04: based on ubuntu:18.04
* 16.04: based on ubuntu:16.04
## Pull image
```
docker pull dcsunset/ubuntu-vnc:<tag>
docker pull dcsunset/archlinux-vnc
```
The tag can be one of those listed above.
@ -34,7 +25,7 @@ The tag can be one of those listed above.
Simple usage:
```
docker run -d -p 5900:5900 -p 6080:6080 -e VNC_PASSWD=password dcsunset/ubuntu-vnc
docker run -d -p 5900:5900 -p 6080:6080 -e VNC_PASSWD=password dcsunset/archlinux-vnc
```
Then visit <http://localhost:6080> to visit noVNC UI.
@ -55,27 +46,19 @@ it is **insecure** when exposing the container on the Internet.
To make the image lightweight,
only the following applications are installed by default:
* Xfce desktop
* TigerVNC server
* xfce4
* tigervnc
* noVNC
* wget
* Python3
* Vim
* Chromium browser
* vim
* chromium
## Build
To use the latest Ubuntu image:
```
docker build -t ubuntu-vnc .
docker build -t archlinux-vnc .
```
Or specify a version:
```
docker build --build-arg VERSION=18.04 -t ubuntu-vnc .
```
## FAQ
@ -87,19 +70,19 @@ install the font packs based on your needs.
To install the Indian font pack:
```
apt-get install fonts-indic
pacman -Sy fonts-indic
```
To install the CJK font pack:
```
apt-get install fonts-noto-cjk
pacman -Sy fonts-noto-cjk
```
To install the international font pack:
```
apt-get install fonts-noto
pacman -Sy fonts-noto
```
### Scaling

View file

@ -4,7 +4,7 @@ Version=1.0
Encoding=UTF-8
Type=X-XFCE-Helper
X-XFCE-Category=WebBrowser
X-XFCE-CommandsWithParameter=chromium-browser --no-sandbox "%s"
Icon=chromium-browser
Name=chromium-browser
X-XFCE-Commands=chromium-browser --no-sandbox
X-XFCE-CommandsWithParameter=chromium --no-sandbox "%s"
Icon=chromium
Name=chromium
X-XFCE-Commands=chromium --no-sandbox

View file

@ -1,13 +0,0 @@
#!/bin/bash
# original docker build command
echo "overwriting docker build -f $DOCKERFILE_PATH -t $IMAGE_NAME ."
cat "versions.txt" | while read VERSION
do
# The new image tag will include the version of ubuntu
IMAGE_TAG="${DOCKER_REPO}:${VERSION}"
echo "docker build -f Dockerfile --build-arg VERSION=${VERSION} -t ${IMAGE_TAG} ."
docker build -f Dockerfile --build-arg VERSION=${VERSION} -t ${IMAGE_TAG} .
done

View file

@ -1,13 +0,0 @@
#!/bin/bash
# original docker push command
echo "overwriting docker push $IMAGE_NAME"
cat "versions.txt" | while read VERSION
do
# The new image tag will include the version of ubuntu
IMAGE_TAG="${DOCKER_REPO}:${VERSION}"
echo "docker push ${IMAGE_TAG}"
docker push ${IMAGE_TAG}
done

View file

@ -4,15 +4,13 @@ umask 0077 # use safe default permissions
mkdir -p "$HOME/.vnc" # create config directory
chmod go-rwx "$HOME/.vnc" # enforce safe permissions
tigervnc_path="/tigervnc-${tigervnc_version}.x86_64/usr/bin"
# Start TigerVNC
if [ ! -z $VNC_PASSWD ]; then
${tigervnc_path}/vncpasswd -f <<< "$VNC_PASSWD" > "$HOME/.vnc/passwd"
${tigervnc_path}/vncserver -rfbport 5900
vncpasswd -f <<< "$VNC_PASSWD" > "$HOME/.vnc/passwd"
vncserver -rfbport 5900
else
${tigervnc_path}/vncpasswd -f <<< "" > "$HOME/.vnc/passwd"
${tigervnc_path}/vncserver -rfbport 5900 -SecurityTypes None
vncpasswd -f <<< "" > "$HOME/.vnc/passwd"
vncserver -rfbport 5900 -SecurityTypes None
fi
# Start noVNC

View file

@ -1,3 +0,0 @@
latest
18.04
16.04