Skip to content

Commit 628039a

Browse files
committed
added dev container for building kasmvnc
1 parent 3e979c5 commit 628039a

6 files changed

+72
-7
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*.lo
55
.deps
66
.libs
7+
*.swp
78

89
CMakeFiles
910
CMakeCache.txt
@@ -12,6 +13,10 @@ Makefile
1213
Makefile.in
1314
config.h
1415

16+
libjpeg-turbo/
17+
xorg.build/
18+
install_manifest.txt
19+
1520
builder/build/
1621
builder/www/
1722
spec/tmp

BUILDING.txt

+26
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,32 @@ For in-tree builds, these directories are the same.
7171
Building KasmVNC
7272
=================
7373

74+
Building the KasmVNC Server using Docker
75+
----------------------------------------
76+
77+
```bash
78+
git submodule init
79+
git submodule update --remote --merge
80+
sudo docker build -t kasmvnc:dev -f builder/dockerfile.ubuntu_jammy.dev .
81+
sudo docker run -it -v ./:/src -p 6901:6901 kasmvnc:dev
82+
```
83+
84+
Now from inside the container.
85+
86+
```bash
87+
kasm-user@5c2802e4cf1e:/src$ sudo builder/scripts/build-webp
88+
kasm-user@5c2802e4cf1e:/src$ sudo builder/scripts/build-build-libjpeg-turbo
89+
kasm-user@5c2802e4cf1e:/src$ builder/build.sh
90+
```
91+
92+
Now run Xvnc and Xfce4 from inside the container
93+
94+
```bash
95+
/src/xorg.build/bin/Xvnc -interface 0.0.0.0 -PublicIP 127.0.0.1 -disableBasicAuth -RectThreads 0 -Log *:stdout:100 -httpd /src/kasmweb/dist -sslOnly 0 -SecurityTypes None -websocketPort 6901 :1
96+
/usr/bin/xfce4-session --display :1
97+
```
98+
99+
Now open a browser and navigate to your dev VM on port 6901.
74100

75101
Building the KasmVNC Server on Modern Unix/Linux Systems
76102
---------------------------------------------------------

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ if(ENABLE_NLS)
245245
add_subdirectory(po)
246246
endif()
247247

248-
add_subdirectory(tests)
248+
####add_subdirectory(tests)
249249

250250

251251
include(cmake/BuildPackages.cmake)

builder/dockerfile.ubuntu_jammy.dev

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM kasmweb/ubuntu-jammy-desktop:develop
2+
3+
ENV KASMVNC_BUILD_OS ubuntu
4+
ENV KASMVNC_BUILD_OS_CODENAME jammy
5+
ENV XORG_VER 21.1.3
6+
ENV XORG_PATCH 21
7+
ENV DEBIAN_FRONTEND noninteractive
8+
9+
EXPOSE 6901
10+
11+
USER root
12+
13+
RUN sed -i 's$# deb-src$deb-src$' /etc/apt/sources.list && \
14+
apt update && \
15+
apt install -y socat sudo libxfont-dev cmake git libgnutls28-dev vim wget tightvncserver curl libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev libxrandr-dev libxcursor-dev pkg-config libfreetype6-dev libxtst-dev autoconf automake libtool xutils-dev libpixman-1-dev libxshmfence-dev libxcvt-dev libxkbfile-dev x11proto-dev libgbm-dev inotify-tools && \
16+
echo "kasm-user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
17+
18+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
19+
RUN apt install -y nodejs
20+
21+
USER 1000
22+
23+
WORKDIR /src
24+
25+
ENTRYPOINT /bin/bash

builder/scripts/build-libjpeg-turbo

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ensure_libjpeg_is_fast() {
2222
prepare_libjpeg_source() {
2323
export JPEG_TURBO_RELEASE=$(curl -sX GET "https://api.github.com/repos/libjpeg-turbo/libjpeg-turbo/releases/latest" \
2424
| awk '/tag_name/{print $4;exit}' FS='[""]')
25+
[ -d ./libjpeg-turbo ] && rm -rf ./libjpeg-turbo
2526
mkdir libjpeg-turbo
2627
curl -Ls "https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_TURBO_RELEASE}.tar.gz" | \
2728
tar xzvf - -C libjpeg-turbo/ --strip-components=1

builder/scripts/build-webp

+14-6
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,30 @@
22

33
set -euo pipefail
44

5-
webp_tar_url=https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.4.tar.gz
5+
WEBP_VERSION="1.2.4"
6+
WEBP_TAR_URL="https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz"
7+
WEBP_TAR_FILE="/tmp/libwebp-${WEBP_VERSION}.tar.gz"
8+
WEBP_SRC_DIR="/tmp/libwebp-${WEBP_VERSION}"
69

710
prepare_source() {
811
cd /tmp
9-
wget "$webp_tar_url"
10-
tar -xzf /tmp/libwebp-*
11-
rm /tmp/libwebp-*.tar.gz
12-
cd /tmp/libwebp-*
12+
13+
# Remove old files if they exist
14+
[ -f "$WEBP_TAR_FILE" ] && rm "$WEBP_TAR_FILE"
15+
[ -d "$WEBP_SRC_DIR" ] && rm -rf "$WEBP_SRC_DIR"
16+
17+
wget "$WEBP_TAR_URL"
18+
tar -xzf "$WEBP_TAR_FILE"
19+
cd "$WEBP_SRC_DIR"
1320
}
1421

1522
build_and_install() {
16-
export MAKEFLAGS=-j`nproc`
23+
export MAKEFLAGS=-j$(nproc)
1724
./configure --enable-static --disable-shared
1825
make
1926
make install
2027
}
2128

2229
prepare_source
2330
build_and_install
31+

0 commit comments

Comments
 (0)