-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-- cp init +src/xdpy +src/fontconfig mv src/tigervnc +gcc/static/README cp cut: Dockerfile sq: +dfile.sh alpine-build.sh; +Dockerfile.xx -- dockerfile.xx sh ig x3 +alpine-build.sh +dfile.sh registry.cn-shenzhen.aliyuncs.com/infrasync/ curl -# -L https://ghproxy.com zh repo TIGERVNC_URL=https://ghproxy.com/ BUILDPLATFORM COPY --link sq: up gcc/static -- fix cp out: /mnt/rootfs/opt/base fix sort notes notes notes out apk pwd; ls -lah /mnt/$file /mnt/$file down_catfile RUN export domain="mirrors.ustc.edu.cn"; \ ping -c 2 qq.com sh buld.sh s s curl -# -k -fSL $RUN export CC=xx-clang \ notes base out base ping -c 2 qq.com fix export f docker build xx sq: update gcc/static -- sort buildOne buildOne apk repo FROM alpine:3.15 img=$ns/docker-headless:compile-alpine-3.15-xx-rootfs-tiger mkdir -p /tmp/xdpyprobe run build # exit 0 without BUILDPLATFORM repo=$1 BUILDPLATFORM=linux/arm notes top PLATFORM export BUILDPLATFORM=linux/arm ls -lhaS ARG BUILDPLATFORM=linux/amd64 ARG TARGETPLATFORM sed -i "s^ARG BUILDPLATFORM=linux/amd64^ARG BUILDPLATFORM^g" Dockerfile.xx.hub \cp -a /usr/bin/upx /mnt/rootfs${targetDir}/bin/ #+upx ns=infrastlabs # it="-it" # buildx-with-cache exact sed # view,validate BUILDPLATFORM sed repo fill drops #opt>usr?? \cp -a src/xdpyprobe/* /tmp/xdpyprobe/ 共历时172秒 clear /mnt/logs # do_fontconfig gawk; 2>&1 pwd; ls -laSh tee -a $logfile print_time_cost $begin_time x4 mkdir -p func; time do_tiger |tee /mnt/logs/do_tiger.log mv down_catfile rm -rf /mnt/rootfs #clear dfile export targetDir=/opt/base; /usr tiger export targetDir=/opt/base export targetDir=/opt/base mkdir -p /tmp/upx mkdir -p / up info format up ## Build ## Built; - xdpyprobe
- Loading branch information
sam#gemmi-win10
committed
Oct 20, 2024
1 parent
2f37ad4
commit 75d0bf4
Showing
14 changed files
with
1,432 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.tar.gz | ||
*.tar.xz | ||
*.tar.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
# ARG BASEIMAGE=unknown | ||
ARG BASEIMAGE=ubuntu:20.04 | ||
ARG BUILDPLATFORM=linux/amd64 | ||
# Define the Alpine packages to be installed into the image. | ||
ARG ALPINE_PKGS="\ | ||
# Needed to generate self-signed certificates | ||
openssl \ | ||
# Needed to use netcat with unix socket. | ||
netcat-openbsd \ | ||
" | ||
# Define the Debian/Ubuntu packages to be installed into the image. | ||
ARG DEBIAN_PKGS="\ | ||
# Used to determine if nginx is ready. | ||
netcat \ | ||
# For ifconfig | ||
net-tools \ | ||
# Needed to generate self-signed certificates | ||
openssl \ | ||
" | ||
|
||
# Get Dockerfile cross-compilation helpers. | ||
FROM --platform=$BUILDPLATFORM registry.cn-shenzhen.aliyuncs.com/infrasync/tonistiigi-xx AS xx | ||
|
||
# Build UPX. | ||
FROM --platform=$BUILDPLATFORM registry.cn-shenzhen.aliyuncs.com/infrasync/alpine:3.15 AS upx | ||
# https://gitee.com/infrastlabs/alpine-ext/blob/master/src/build.sh | ||
# https://www.jakehu.me/2021/alpine-mirrors/ | ||
# domain="mirrors.ustc.edu.cn" | ||
# domain="mirrors.aliyun.com"; | ||
# mirrors.tuna.tsinghua.edu.cn | ||
RUN domain="mirrors.tuna.tsinghua.edu.cn"; \ | ||
echo "http://$domain/alpine/v3.15/main" > /etc/apk/repositories; \ | ||
echo "http://$domain/alpine/v3.15/community" >> /etc/apk/repositories | ||
RUN apk --no-cache add build-base curl make cmake git && \ | ||
mkdir /tmp/upx && \ | ||
curl -# -L https://ghproxy.com/https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-src.tar.xz | tar xJ --strip 1 -C /tmp/upx && \ | ||
make -C /tmp/upx build/release-gcc -j$(nproc) && \ | ||
cp -v /tmp/upx/build/release-gcc/upx /usr/bin/upx | ||
|
||
# Build TigerVNC server. | ||
FROM --platform=$BUILDPLATFORM registry.cn-shenzhen.aliyuncs.com/infrasync/alpine:3.15 AS tigervnc | ||
RUN domain="mirrors.tuna.tsinghua.edu.cn"; \ | ||
echo "http://$domain/alpine/v3.15/main" > /etc/apk/repositories; \ | ||
echo "http://$domain/alpine/v3.15/community" >> /etc/apk/repositories | ||
ARG TARGETPLATFORM | ||
COPY --from=xx / / | ||
COPY src/tigervnc /build | ||
RUN /build/build.sh | ||
RUN xx-verify --static /tmp/tigervnc-install/usr/bin/Xvnc | ||
RUN xx-verify --static /tmp/tigervnc-install/usr/bin/vncpasswd | ||
COPY --from=upx /usr/bin/upx /usr/bin/upx | ||
RUN upx /tmp/tigervnc-install/usr/bin/Xvnc | ||
RUN upx /tmp/tigervnc-install/usr/bin/vncpasswd | ||
|
||
# Build Fontconfig. | ||
FROM --platform=$BUILDPLATFORM registry.cn-shenzhen.aliyuncs.com/infrasync/alpine:3.15 AS fontconfig | ||
RUN domain="mirrors.tuna.tsinghua.edu.cn"; \ | ||
echo "http://$domain/alpine/v3.15/main" > /etc/apk/repositories; \ | ||
echo "http://$domain/alpine/v3.15/community" >> /etc/apk/repositories | ||
ARG TARGETPLATFORM | ||
COPY --from=xx / / | ||
COPY src/fontconfig/build.sh /tmp/build-fontconfig.sh | ||
RUN /tmp/build-fontconfig.sh | ||
|
||
# Build xdpyprobe. | ||
# Used to determine if the X server (Xvnc) is ready. | ||
FROM --platform=$BUILDPLATFORM registry.cn-shenzhen.aliyuncs.com/infrasync/alpine:3.15 AS xdpyprobe | ||
RUN domain="mirrors.tuna.tsinghua.edu.cn"; \ | ||
echo "http://$domain/alpine/v3.15/main" > /etc/apk/repositories; \ | ||
echo "http://$domain/alpine/v3.15/community" >> /etc/apk/repositories | ||
ARG TARGETPLATFORM | ||
COPY --from=xx / / | ||
COPY src/xdpyprobe /tmp/xdpyprobe | ||
RUN apk --no-cache add make clang | ||
RUN xx-apk --no-cache add gcc musl-dev libx11-dev libx11-static libxcb-static | ||
RUN CC=xx-clang \ | ||
make -C /tmp/xdpyprobe | ||
RUN xx-verify --static /tmp/xdpyprobe/xdpyprobe | ||
COPY --from=upx /usr/bin/upx /usr/bin/upx | ||
RUN upx /tmp/xdpyprobe/xdpyprobe | ||
|
||
# Pull base image. | ||
FROM ${BASEIMAGE} | ||
ARG TARGETPLATFORM | ||
RUN export DOMAIN="mirrors.ustc.edu.cn"; \ | ||
test -z "$(echo $TARGETPLATFORM |grep arm)" && target=ubuntu || target=ubuntu-ports; \ | ||
echo "deb http://${DOMAIN}/$target focal main restricted universe multiverse" > /etc/apt/sources.list \ | ||
&& echo "deb http://${DOMAIN}/$target focal-updates main restricted universe multiverse">> /etc/apt/sources.list; | ||
WORKDIR /tmp | ||
# Install system packages. | ||
ARG ALPINE_PKGS | ||
ARG DEBIAN_PKGS | ||
RUN \ | ||
if [ -n "$(which apk)" ]; then \ | ||
add-pkg ${ALPINE_PKGS}; \ | ||
else \ | ||
add-pkg ${DEBIAN_PKGS}; \ | ||
fi && \ | ||
# Remove some unneeded stuff. | ||
rm -rf /var/cache/fontconfig/* | ||
|
||
# Add files. | ||
# COPY helpers/* /opt/base/bin/ | ||
# COPY rootfs/ / | ||
# COPY --link | ||
COPY --from=tigervnc /tmp/tigervnc-install/usr/bin/Xvnc /opt/base/bin/ | ||
COPY --from=tigervnc /tmp/tigervnc-install/usr/bin/vncpasswd /opt/base/bin/ | ||
COPY --from=tigervnc /tmp/xkb-install/usr/share/X11/xkb /opt/base/share/X11/xkb | ||
COPY --from=tigervnc /tmp/xkbcomp-install/usr/bin/xkbcomp /opt/base/bin/ | ||
# COPY --from=openbox /tmp/openbox-install/usr/bin/openbox /opt/base/bin/ | ||
# COPY --from=openbox /tmp/openbox-install/usr/bin/obxprop /opt/base/bin/ | ||
COPY --from=fontconfig /tmp/fontconfig-install/opt /opt | ||
COPY --from=xdpyprobe /tmp/xdpyprobe/xdpyprobe /opt/base/bin/ | ||
# COPY --from=yad /tmp/yad-install/usr/bin/yad /opt/base/bin/ | ||
# COPY --from=nginx /tmp/nginx-install /opt/base/ | ||
# COPY --from=dhparam /tmp/dhparam.pem /defaults/ | ||
# COPY --from=noVNC /opt/noVNC /opt/noVNC | ||
|
||
# Set environment variables. | ||
ENV \ | ||
DISPLAY_WIDTH=1920 \ | ||
DISPLAY_HEIGHT=1080 \ | ||
DARK_MODE=0 \ | ||
SECURE_CONNECTION=0 \ | ||
SECURE_CONNECTION_VNC_METHOD=SSL \ | ||
SECURE_CONNECTION_CERTS_CHECK_INTERVAL=60 \ | ||
WEB_LISTENING_PORT=5800 \ | ||
VNC_LISTENING_PORT=5900 \ | ||
VNC_PASSWORD= \ | ||
ENABLE_CJK_FONT=0 | ||
|
||
# Expose ports. | ||
# - 5800: VNC web interface | ||
# - 5900: VNC | ||
EXPOSE 5800 5900 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
|
||
# ARG BUILDPLATFORM=linux/amd64 | ||
# ARG TARGETPLATFORM | ||
# FROM --platform=$BUILDPLATFORM registry.cn-shenzhen.aliyuncs.com/infrasync/tonistiigi-xx AS xx | ||
FROM registry.cn-shenzhen.aliyuncs.com/infrasync/tonistiigi-xx AS xx | ||
|
||
# ARG BUILDPLATFORM=linux/amd64 | ||
# ARG TARGETPLATFORM | ||
# FROM --platform=$BUILDPLATFORM registry.cn-shenzhen.aliyuncs.com/infrasync/alpine:3.15 AS upx | ||
FROM registry.cn-shenzhen.aliyuncs.com/infrasync/alpine:3.15 AS upx | ||
COPY --from=xx / / | ||
|
||
# https://gitee.com/infrastlabs/alpine-ext/blob/master/src/build.sh | ||
# https://www.jakehu.me/2021/alpine-mirrors/ | ||
# domain="mirrors.ustc.edu.cn" | ||
# domain="mirrors.aliyun.com"; | ||
# mirrors.tuna.tsinghua.edu.cn | ||
RUN export domain="mirrors.ustc.edu.cn"; \ | ||
echo "http://$domain/alpine/v3.15/main" > /etc/apk/repositories; \ | ||
echo "http://$domain/alpine/v3.15/community" >> /etc/apk/repositories | ||
RUN ping -c 2 qq.com; apk update; \ | ||
apk --no-cache add build-base curl make cmake git | ||
|
||
|
||
###TIGERVNC | ||
# log "Installing required Alpine packages..." | ||
# ping -c 2 qq.com | ||
RUN apk --no-cache add \ | ||
curl \ | ||
build-base \ | ||
clang \ | ||
cmake \ | ||
autoconf \ | ||
automake \ | ||
libtool \ | ||
pkgconf \ | ||
meson \ | ||
util-macros \ | ||
font-util-dev \ | ||
xtrans | ||
|
||
# ping -c 2 qq.com | ||
RUN xx-apk --no-cache --no-scripts add \ | ||
g++ \ | ||
xcb-util-dev \ | ||
pixman-dev \ | ||
libx11-dev \ | ||
libgcrypt-dev \ | ||
libgcrypt-static \ | ||
libgpg-error-static \ | ||
libxkbfile-dev \ | ||
libxfont2-dev \ | ||
libjpeg-turbo-dev \ | ||
nettle-dev \ | ||
libunistring-dev \ | ||
gnutls-dev \ | ||
fltk-dev \ | ||
libxrandr-dev \ | ||
libxtst-dev \ | ||
freetype-dev \ | ||
libfontenc-dev \ | ||
zlib-dev \ | ||
libx11-static \ | ||
libxcb-static \ | ||
zlib-static \ | ||
pixman-static \ | ||
libjpeg-turbo-static \ | ||
freetype-static \ | ||
libpng-static \ | ||
bzip2-static \ | ||
brotli-static \ | ||
libunistring-static \ | ||
nettle-static \ | ||
gettext-static \ | ||
libunistring-dev \ | ||
libbsd-dev | ||
|
||
|
||
###FONTCONFIG | ||
# log "Installing required Alpine packages..." | ||
RUN apk --no-cache add \ | ||
curl \ | ||
build-base \ | ||
clang \ | ||
pkgconfig \ | ||
gperf \ | ||
python3 \ | ||
font-croscore | ||
|
||
RUN xx-apk --no-cache --no-scripts add \ | ||
glib-dev \ | ||
g++ \ | ||
freetype-dev \ | ||
expat-dev | ||
|
||
|
||
###XDPY | ||
RUN xx-apk --no-cache add gcc musl-dev libx11-dev libx11-static libxcb-static | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
|
||
## Build | ||
|
||
dfile.sh | ||
|
||
- upx | ||
- tiger/build.sh | ||
- gnutls | ||
- libxfont2 | ||
- libfontenc | ||
- libtasn1 | ||
- libxshmfence | ||
- tigervnc/xorg-server | ||
- common | ||
- unix/common | ||
- unix/passwd | ||
- unix/xserver | ||
- X11/xkb:xkeyboard-config | ||
- xkbcomp | ||
- xdpyprobe/ | ||
- | ||
- fontconfig/build.sh | ||
- openbox | ||
- gtk's yad | ||
- nginx | ||
- novnc | ||
|
||
|
||
|
||
## Built | ||
|
||
```bash | ||
# host-21-60:/_ext/working/_ee/ubt-armv7/ubt-core/src/gcc/static # find rootfs/ |grep -v font | ||
rootfs/ | ||
rootfs/opt | ||
rootfs/opt/opt | ||
rootfs/opt/opt/base | ||
rootfs/opt/opt/base/share | ||
rootfs/opt/base | ||
rootfs/opt/base/bin | ||
rootfs/opt/base/bin/xdpyprobe | ||
rootfs/opt/base/bin/Xvnc | ||
rootfs/opt/base/bin/vncpasswd | ||
rootfs/opt/base/share | ||
rootfs/opt/base/share/X11 | ||
|
||
# host-21-60:/_ext/working/_ee/ubt-armv7/ubt-core/src/gcc/static # ll -Sh | ||
total 23M | ||
-rw-r--r-- 1 root root 9.0M Oct 16 23:39 xorg-server-1.20.14.tar.gz | ||
-rw-r--r-- 1 root root 5.8M Oct 16 23:14 gnutls-3.7.1.tar.xz | ||
-rw-r--r-- 1 root root 1.9M Oct 16 23:21 v1.13.1.tar.gz | ||
-rw-r--r-- 1 root root 1.7M Oct 16 23:45 xkeyboard-config-2.32.tar.bz2 | ||
-rw-r--r-- 1 root root 1.7M Oct 16 23:20 libtasn1-4.18.0.tar.gz | ||
-rw-r--r-- 1 root root 1.2M Oct 16 23:06 upx-4.0.1-src.tar.xz | ||
-rw-r--r-- 1 root root 6.1K Oct 16 23:36 dfile.sh | ||
-rw-r--r-- 1 root root 5.3K Oct 16 22:15 Dockerfile | ||
drwxr-xr-x 2 root root 4.0K Oct 17 00:01 _build #32K | ||
drwxr-xr-x 17 root root 4.0K Oct 17 00:08 _tmp #274M | ||
drwxr-xr-x 3 root root 4.0K Oct 16 23:43 rootfs #6M | ||
drwxr-xr-x 5 root root 4.0K Oct 16 20:54 src | ||
-rw-r--r-- 1 root root 3.1K Oct 17 00:00 README.md | ||
-rw-r--r-- 1 root root 2.2K Oct 16 23:25 Dockerfile.xx | ||
-rw-r--r-- 1 root root 317 Oct 17 00:00 alpine-build.sh | ||
-rw-r--r-- 1 root root 31 Oct 16 23:21 .gitignore | ||
``` | ||
|
||
- xdpyprobe | ||
|
||
```bash | ||
host-21-60:/_ext/working/_ee/ubt-armv7/ubt-core/src/gcc/static # rootfs/opt/base/bin/xdpyprobe -h | ||
Usage: xdpyprobe [OPTIONS] [DISPLAY] | ||
Check connectivity of the X server defined by DISPLAY. | ||
If DISPLAY is not specified, use $DISPLAY environment variable. | ||
|
||
Options: | ||
-q, --quiet do not display any output | ||
-h, --help display help message and exit | ||
-v, --version display version message and exit | ||
|
||
Exit status: | ||
0 if connection to DISPLAY succeeded; | ||
1 if connection to DISPLAY failed; | ||
255 if X server connectivity was not probed (e.g., when | ||
the help message is displayed). | ||
``` | ||
## Ref | ||
- https://gitee.com/infrastlabs/fk-docker-baseimage-gui/blob/master/.github/workflows/build-baseimage.yml | ||
```yml | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
info: | ||
- '{ "tag_prefix": "alpine-3.14", "baseimage": "jlesage/baseimage:alpine-3.14-v3.4.7", "platforms": "linux/amd64,linux/386,linux/arm/v6,linux/arm/v7,linux/arm64/v8" }' | ||
- '{ "tag_prefix": "alpine-3.15", "baseimage": "jlesage/baseimage:alpine-3.15-v3.4.7", "platforms": "linux/amd64,linux/386,linux/arm/v6,linux/arm/v7,linux/arm64/v8" }' | ||
- '{ "tag_prefix": "alpine-3.16", "baseimage": "jlesage/baseimage:alpine-3.16-v3.4.7", "platforms": "linux/amd64,linux/386,linux/arm/v6,linux/arm/v7,linux/arm64/v8" }' | ||
- '{ "tag_prefix": "alpine-3.17", "baseimage": "jlesage/baseimage:alpine-3.17-v3.4.7", "platforms": "linux/amd64,linux/386,linux/arm/v6,linux/arm/v7,linux/arm64/v8" }' | ||
- '{ "tag_prefix": "alpine-3.18", "baseimage": "jlesage/baseimage:alpine-3.18-v3.4.7", "platforms": "linux/amd64,linux/386,linux/arm/v6,linux/arm/v7,linux/arm64/v8" }' | ||
- '{ "tag_prefix": "debian-10", "baseimage": "jlesage/baseimage:debian-10-v3.4.7", "platforms": "linux/amd64,linux/386,linux/arm/v7,linux/arm64/v8" }' | ||
- '{ "tag_prefix": "debian-11", "baseimage": "jlesage/baseimage:debian-11-v3.4.7", "platforms": "linux/amd64,linux/386,linux/arm/v7,linux/arm64/v8" }' | ||
- '{ "tag_prefix": "ubuntu-16.04", "baseimage": "jlesage/baseimage:ubuntu-16.04-v3.4.7", "platforms": "linux/amd64,linux/386,linux/arm/v7,linux/arm64/v8" }' | ||
- '{ "tag_prefix": "ubuntu-18.04", "baseimage": "jlesage/baseimage:ubuntu-18.04-v3.4.7", "platforms": "linux/amd64,linux/386,linux/arm/v7,linux/arm64/v8" }' | ||
- '{ "tag_prefix": "ubuntu-20.04", "baseimage": "jlesage/baseimage:ubuntu-20.04-v3.4.7", "platforms": "linux/amd64,linux/arm/v7,linux/arm64/v8" }' | ||
- '{ "tag_prefix": "ubuntu-22.04", "baseimage": "jlesage/baseimage:ubuntu-22.04-v3.4.7", "platforms": "linux/amd64,linux/arm/v7,linux/arm64/v8" }' | ||
|
||
|
||
``` |
Oops, something went wrong.