Skip to content

Commit 512df7c

Browse files
authored
Add Ubuntu 22.04 (#1)
* fix: Re-enable /resize URI * Update for Ubuntu 22.04 (WIP) LXDE shows "Failed to close file descriptor for child process" error * fix: Fix noVNC launch error * ci: Add GitHub Actions config * fix: Fix arm64 execution error qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory * ci: Fix config * chore: Clean-up Makefile * ci: Fix submodule clone error
1 parent e4922ce commit 512df7c

File tree

9 files changed

+240
-337
lines changed

9 files changed

+240
-337
lines changed

.github/workflows/deploy.yaml

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- master
6+
paths-ignore:
7+
- 'docs/**'
8+
- '**.md'
9+
workflow_dispatch:
10+
11+
env:
12+
DOCKER_USERNAME: tiryoh
13+
DOCKER_IMAGENAME: ubuntu-desktop-lxde-vnc
14+
GIT_CONFIG_USER: Tiryoh@GitHubActions
15+
GIT_CONFIG_EMAIL: [email protected]
16+
17+
jobs:
18+
build-and-deploy:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
distro:
23+
- jammy
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
with:
29+
fetch-depth: 0
30+
submodules: true
31+
32+
- name: Setup QEMU
33+
uses: docker/setup-qemu-action@v1
34+
35+
- name: Setup Docker Buildx
36+
id: buildx
37+
uses: docker/setup-buildx-action@v1
38+
39+
- name: Login to docker.io
40+
uses: docker/login-action@v1
41+
with:
42+
username: ${{ env.DOCKER_USERNAME }}
43+
password: ${{ secrets.DOCKERHUB_TOKEN }}
44+
45+
- name: Cache Docker layers
46+
uses: actions/cache@v2
47+
with:
48+
path: /tmp/.buildx-cache
49+
key: ${{ runner.os }}-buildx-${{ github.sha }}
50+
restore-keys: |
51+
${{ runner.os }}-buildx-
52+
53+
- name: Prepare Docker metadata
54+
id: meta
55+
uses: docker/metadata-action@v3
56+
with:
57+
images: |
58+
${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_IMAGENAME }}
59+
tags: |
60+
type=raw,value=${{ matrix.distro }}
61+
type=raw,value=${{ matrix.distro }}-{{date 'YYYYMMDDTHHmm'}}
62+
flavor: |
63+
latest=${{ matrix.distro == 'jammy' }}
64+
prefix=
65+
suffix=
66+
67+
- name: Build and Publish
68+
id: docker-build
69+
uses: docker/build-push-action@v2
70+
with:
71+
context: .
72+
platforms: linux/amd64, linux/arm64
73+
outputs: type=registry # same as --push, push: true
74+
tags: ${{ steps.meta.outputs.tags }}
75+
labels: ${{ steps.meta.outputs.labels }}
76+
cache-from: type=local,src=/tmp/.buildx-cache
77+
cache-to: type=local,dest=/tmp/.buildx-cache-new
78+
79+
- # Temp fix
80+
# https://github.com/docker/build-push-action/issues/252
81+
# https://github.com/moby/buildkit/issues/1896
82+
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md
83+
name: Move cache
84+
run: |
85+
rm -rf /tmp/.buildx-cache
86+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
87+
88+
- name: Get Current Job Log URL
89+
id: jobs
90+
uses: Tiryoh/gha-jobid-action@v0
91+
with:
92+
github_token: ${{ secrets.GITHUB_TOKEN }}
93+
job_name: build-and-deploy (${{ matrix.distro }})
94+
95+
- name: Update wiki
96+
env:
97+
DOCKER_TAGNAME: ${{ matrix.distro }}
98+
run: |
99+
DOCKER_SNAPSHOT=$(cat << EOF | grep ".*-.*T.*" | sed -E "s/.*:(.*-[0-9]*T[0-9])/\1/g"
100+
${{ steps.meta.outputs.tags }}
101+
EOF)
102+
echo $DOCKER_SNAPSHOT
103+
DOCKER_DIGEST=${{ steps.docker-build.outputs.digest }}
104+
echo $DOCKER_DIGEST
105+
DOCKER_DIGEST_SHORT=$(echo ${DOCKER_DIGEST} | sed -E 's/.*([0-9a-z]{12})[0-9a-z]{52}$/\1/g')
106+
echo $DOCKER_DIGEST_SHORT
107+
DOCKER_SNAPSHOT_IMAGE_HISTORY_URL=$(echo "https://hub.docker.com/r/${DOCKER_USERNAME}/${DOCKER_IMAGENAME}/tags?page=1&name=${DOCKER_SNAPSHOT}")
108+
git clone --depth=1 https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.wiki.git wiki
109+
cd wiki
110+
LINE=$(grep -n "add ${{ matrix.distro }} msg after this line" ${{ matrix.distro }}.md | cut -d ":" -f 1)
111+
head -n $LINE ${{ matrix.distro }}.md > tmp.md
112+
echo "* \`${DOCKER_DIGEST_SHORT}\`" | tee -a tmp.md
113+
echo " * uploaded on $(date --iso-8601="minutes")" | tee -a tmp.md
114+
echo " * ${{ steps.jobs.outputs.html_url }}" | tee -a tmp.md
115+
echo " * snapshot" | tee -a tmp.md
116+
echo " * [\`${DOCKER_SNAPSHOT}\`](${DOCKER_SNAPSHOT_IMAGE_HISTORY_URL})" | tee -a tmp.md
117+
tail -n +$(( $LINE+1 )) ${{ matrix.distro }}.md >> tmp.md
118+
mv tmp.md ${{ matrix.distro }}.md
119+
git config --local user.email "${GIT_CONFIG_EMAIL}"
120+
git config --local user.name "${GIT_CONFIG_USER}"
121+
git add ${{ matrix.distro }}.md
122+
git commit -m "Update ${{ matrix.distro }}.md"
123+
git fetch origin && git merge origin/master --no-edit && git push origin master || \
124+
git fetch origin && git merge origin/master --no-edit && git push origin master

Dockerfile.amd64

+44-33
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,75 @@
1-
# Built with arch: amd64 flavor: lxde image: ubuntu:20.04
1+
# Built with arch: amd64 flavor: lxde image: ubuntu:jammy-20220531
22
#
33
################################################################################
44
# base system
55
################################################################################
66

7-
FROM ubuntu:20.04 as system
7+
FROM ubuntu:jammy-20220531 as system
88

99

10+
ENV DEBIAN_FRONTEND noninteractive
11+
RUN apt-get update \
12+
&& apt-get install -y --no-install-recommends ca-certificates \
13+
&& apt-get autoclean -y \
14+
&& apt-get autoremove -y \
15+
&& rm -rf /var/lib/apt/lists/*
1016

1117
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
1218

13-
1419
# built-in packages
15-
ENV DEBIAN_FRONTEND noninteractive
16-
RUN apt update \
17-
&& apt install -y --no-install-recommends software-properties-common curl apache2-utils \
18-
&& apt update \
19-
&& apt install -y --no-install-recommends --allow-unauthenticated \
20+
RUN apt-get update \
21+
&& apt-get install -y --no-install-recommends software-properties-common curl apache2-utils \
22+
&& apt-get update \
23+
&& apt-get install -y --no-install-recommends \
2024
supervisor nginx sudo net-tools zenity xz-utils \
2125
dbus-x11 x11-utils alsa-utils \
2226
mesa-utils libgl1-mesa-dri \
23-
&& apt autoclean -y \
24-
&& apt autoremove -y \
27+
&& apt-get autoclean -y \
28+
&& apt-get autoremove -y \
2529
&& rm -rf /var/lib/apt/lists/*
2630
# install debs error if combine together
27-
RUN apt update \
28-
&& apt install -y --no-install-recommends --allow-unauthenticated \
31+
RUN apt-get update \
32+
&& apt-get install -y --no-install-recommends \
2933
xvfb x11vnc \
30-
vim-tiny firefox ttf-ubuntu-font-family ttf-wqy-zenhei \
31-
&& apt autoclean -y \
32-
&& apt autoremove -y \
34+
vim-tiny firefox fonts-ubuntu \
35+
&& apt-get autoclean -y \
36+
&& apt-get autoremove -y \
3337
&& rm -rf /var/lib/apt/lists/*
34-
35-
RUN apt update \
36-
&& apt install -y gpg-agent \
38+
RUN apt-get update \
39+
&& apt-get install -y --no-install-recommends \
40+
gpgconf gnupg gpg-agent \
3741
&& curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
3842
&& (dpkg -i ./google-chrome-stable_current_amd64.deb || apt-get install -fy) \
3943
&& curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add \
4044
&& rm google-chrome-stable_current_amd64.deb \
4145
&& rm -rf /var/lib/apt/lists/*
4246

43-
RUN apt update \
44-
&& apt install -y --no-install-recommends --allow-unauthenticated \
45-
lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \
46-
&& apt autoclean -y \
47-
&& apt autoremove -y \
48-
&& rm -rf /var/lib/apt/lists/*
4947

5048

49+
50+
RUN apt-get update \
51+
&& apt-get install -y --no-install-recommends \
52+
lightdm \
53+
&& apt-get install -y \
54+
lxde \
55+
&& apt-get install -y --no-install-recommends \
56+
gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \
57+
&& apt-get autoclean -y \
58+
&& apt-get autoremove -y \
59+
&& rm -rf /var/lib/apt/lists/*
5160
# Additional packages require ~600MB
5261
# libreoffice pinta language-pack-zh-hant language-pack-gnome-zh-hant firefox-locale-zh-hant libreoffice-l10n-zh-tw
5362

5463
# tini to fix subreap
55-
ARG TINI_VERSION=v0.18.0
56-
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini
57-
RUN chmod +x /bin/tini
64+
RUN apt-get update \
65+
&& apt-get install -y --no-install-recommends tini \
66+
&& apt-get autoclean -y \
67+
&& apt-get autoremove -y \
68+
&& rm -rf /var/lib/apt/lists/*
5869

5970
# ffmpeg
60-
RUN apt update \
61-
&& apt install -y --no-install-recommends --allow-unauthenticated \
71+
RUN apt-get update \
72+
&& apt-get install -y --no-install-recommends \
6273
ffmpeg \
6374
&& rm -rf /var/lib/apt/lists/* \
6475
&& mkdir /usr/local/ffmpeg \
@@ -69,7 +80,7 @@ COPY rootfs/usr/local/lib/web/backend/requirements.txt /tmp/
6980
RUN apt-get update \
7081
&& dpkg-query -W -f='${Package}\n' > /tmp/a.txt \
7182
&& apt-get install -y python3-pip python3-dev build-essential \
72-
&& pip3 install setuptools wheel && pip3 install -r /tmp/requirements.txt \
83+
&& python3 -m pip install setuptools wheel && python3 -m pip install -r /tmp/requirements.txt \
7384
&& ln -s /usr/bin/python3 /usr/local/bin/python \
7485
&& dpkg-query -W -f='${Package}\n' > /tmp/b.txt \
7586
&& apt-get remove -y `diff --changed-group-format='%>' --unchanged-group-format='' /tmp/a.txt /tmp/b.txt | xargs` \
@@ -82,17 +93,17 @@ RUN apt-get update \
8293
################################################################################
8394
# builder
8495
################################################################################
85-
FROM ubuntu:20.04 as builder
96+
97+
FROM ubuntu:jammy-20220531 as builder
8698

8799

88-
RUN sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list;
89100

90101

91102
RUN apt-get update \
92103
&& apt-get install -y --no-install-recommends curl ca-certificates gnupg patch
93104

94105
# nodejs
95-
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
106+
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - \
96107
&& apt-get install -y nodejs
97108

98109
# yarn

Dockerfile.arm64

-129
This file was deleted.

0 commit comments

Comments
 (0)