mirror of
https://github.com/linuxserver/docker-kasm.git
synced 2026-07-20 16:51:03 +00:00
Rebase to Jammy, document and add support for GPUs and Gamepads
This commit is contained in:
parent
85e0bcb212
commit
1a5fcda940
8 changed files with 114 additions and 66 deletions
2
.github/workflows/external_trigger.yml
vendored
2
.github/workflows/external_trigger.yml
vendored
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
fi
|
||||
echo "**** External trigger running off of develop branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_KASM_DEVELOP\". ****"
|
||||
echo "**** Retrieving external version ****"
|
||||
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET 'https://api.github.com/repos/kasmtech/kasm-install-wizard/releases'| jq -r 'map(select(.prerelease)) | sort_by(.published_at) | last | .tag_name')
|
||||
EXT_RELEASE=$(curl -sX GET https://kasm-ci.s3.amazonaws.com/dev-version.txt)
|
||||
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
|
||||
echo "**** Can't retrieve external version, exiting ****"
|
||||
FAILURE_REASON="Can't retrieve external version for kasm branch develop"
|
||||
|
|
|
|||
66
Dockerfile
66
Dockerfile
|
|
@ -1,4 +1,4 @@
|
|||
FROM ghcr.io/linuxserver/baseimage-alpine:3.16
|
||||
FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
|
|
@ -11,40 +11,46 @@ LABEL maintainer="thelamer"
|
|||
ENV DOCKER_TLS_CERTDIR=""
|
||||
ENV TINI_SUBREAPER=true
|
||||
|
||||
#Add needed nvidia environment variables for https://github.com/NVIDIA/nvidia-docker
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES="compute,graphics,video,utility"
|
||||
|
||||
# Container setup
|
||||
RUN \
|
||||
echo "**** install build packages ****" && \
|
||||
apk add --no-cache --virtual=build-dependencies \
|
||||
alpine-sdk \
|
||||
npm && \
|
||||
echo "**** install packages ****" && \
|
||||
apk add --no-cache \
|
||||
bash \
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
|
||||
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable" > \
|
||||
/etc/apt/sources.list.d/docker.list && \
|
||||
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | \
|
||||
gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && \
|
||||
curl -s -L https://nvidia.github.io/libnvidia-container/ubuntu22.04/libnvidia-container.list | \
|
||||
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
|
||||
tee /etc/apt/sources.list.d/nvidia-container-toolkit.list && \
|
||||
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
btrfs-progs \
|
||||
ca-certificates \
|
||||
coreutils \
|
||||
curl \
|
||||
docker \
|
||||
docker-cli-compose \
|
||||
containerd.io \
|
||||
docker-ce \
|
||||
docker-ce-cli \
|
||||
docker-compose-plugin \
|
||||
drm-info \
|
||||
e2fsprogs \
|
||||
e2fsprogs-extra \
|
||||
findutils \
|
||||
fuse-overlayfs \
|
||||
ip6tables \
|
||||
g++ \
|
||||
gcc \
|
||||
iptables \
|
||||
jq \
|
||||
make \
|
||||
nodejs \
|
||||
nvidia-docker2 \
|
||||
openssl \
|
||||
pigz \
|
||||
python3 \
|
||||
shadow-uidmap \
|
||||
sudo \
|
||||
xfsprogs \
|
||||
xz \
|
||||
zfs && \
|
||||
uidmap \
|
||||
xfsprogs && \
|
||||
echo "**** dind setup ****" && \
|
||||
addgroup -S dockremap && \
|
||||
adduser -S -G dockremap dockremap && \
|
||||
useradd -U dockremap && \
|
||||
usermod -G dockremap dockremap && \
|
||||
echo 'dockremap:165536:65536' >> /etc/subuid && \
|
||||
echo 'dockremap:165536:65536' >> /etc/subgid && \
|
||||
curl -o \
|
||||
|
|
@ -55,12 +61,11 @@ RUN \
|
|||
echo "**** setup wizard ****" && \
|
||||
mkdir -p /wizard && \
|
||||
if [ -z ${KASM_VERSION+x} ]; then \
|
||||
KASM_VERSION=$(curl -sX GET 'https://api.github.com/repos/kasmtech/kasm-install-wizard/releases' \
|
||||
| jq -r 'map(select(.prerelease)) | sort_by(.published_at) | last | .tag_name'); \
|
||||
KASM_VERSION=$(curl -sX GET https://kasm-ci.s3.amazonaws.com/dev-version.txt); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/wizard.tar.gz -L \
|
||||
"https://github.com/kasmtech/kasm-install-wizard/archive/refs/tags/${KASM_VERSION}.tar.gz" && \
|
||||
"https://github.com/kasmtech/kasm-install-wizard/tarball/feature/KASM-3512-gpu-option" && \
|
||||
tar xf \
|
||||
/tmp/wizard.tar.gz -C \
|
||||
/wizard --strip-components=1 && \
|
||||
|
|
@ -75,18 +80,19 @@ RUN \
|
|||
/ && \
|
||||
echo "**** copy assets ****" && \
|
||||
cp \
|
||||
/kasm_release/www/img/thumbnails/*.png \
|
||||
/kasm_release/www/img/thumbnails/*.png /kasm_release/www/img/thumbnails/*.svg \
|
||||
/wizard/public/img/thumbnails/ && \
|
||||
cp \
|
||||
/kasm_release/conf/database/seed_data/default_images_a* \
|
||||
/wizard/ && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
apt-get remove -y g++ gcc make && \
|
||||
apt-get -y autoremove && \
|
||||
apt-get clean && \
|
||||
rm -rf \
|
||||
/root/.npm \
|
||||
/root/.cache \
|
||||
/tmp/*
|
||||
/tmp/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/var/tmp/*
|
||||
|
||||
# add init files
|
||||
COPY root/ /
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.16
|
||||
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy
|
||||
|
||||
# set version label
|
||||
ARG BUILD_DATE
|
||||
|
|
@ -11,40 +11,46 @@ LABEL maintainer="thelamer"
|
|||
ENV DOCKER_TLS_CERTDIR=""
|
||||
ENV TINI_SUBREAPER=true
|
||||
|
||||
#Add needed nvidia environment variables for https://github.com/NVIDIA/nvidia-docker
|
||||
ENV NVIDIA_DRIVER_CAPABILITIES="compute,graphics,video,utility"
|
||||
|
||||
# Container setup
|
||||
RUN \
|
||||
echo "**** install build packages ****" && \
|
||||
apk add --no-cache --virtual=build-dependencies \
|
||||
alpine-sdk \
|
||||
npm && \
|
||||
echo "**** install packages ****" && \
|
||||
apk add --no-cache \
|
||||
bash \
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
|
||||
echo "deb [arch=arm64] https://download.docker.com/linux/ubuntu jammy stable" > \
|
||||
/etc/apt/sources.list.d/docker.list && \
|
||||
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | \
|
||||
gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && \
|
||||
curl -s -L https://nvidia.github.io/libnvidia-container/ubuntu22.04/libnvidia-container.list | \
|
||||
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
|
||||
tee /etc/apt/sources.list.d/nvidia-container-toolkit.list && \
|
||||
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
btrfs-progs \
|
||||
ca-certificates \
|
||||
coreutils \
|
||||
curl \
|
||||
docker \
|
||||
docker-cli-compose \
|
||||
containerd.io \
|
||||
docker-ce \
|
||||
docker-ce-cli \
|
||||
docker-compose-plugin \
|
||||
drm-info \
|
||||
e2fsprogs \
|
||||
e2fsprogs-extra \
|
||||
findutils \
|
||||
fuse-overlayfs \
|
||||
ip6tables \
|
||||
g++ \
|
||||
gcc \
|
||||
iptables \
|
||||
jq \
|
||||
make \
|
||||
nodejs \
|
||||
nvidia-docker2 \
|
||||
openssl \
|
||||
pigz \
|
||||
python3 \
|
||||
shadow-uidmap \
|
||||
sudo \
|
||||
xfsprogs \
|
||||
xz \
|
||||
zfs && \
|
||||
uidmap \
|
||||
xfsprogs && \
|
||||
echo "**** dind setup ****" && \
|
||||
addgroup -S dockremap && \
|
||||
adduser -S -G dockremap dockremap && \
|
||||
useradd -U dockremap && \
|
||||
usermod -G dockremap dockremap && \
|
||||
echo 'dockremap:165536:65536' >> /etc/subuid && \
|
||||
echo 'dockremap:165536:65536' >> /etc/subgid && \
|
||||
curl -o \
|
||||
|
|
@ -55,12 +61,11 @@ RUN \
|
|||
echo "**** setup wizard ****" && \
|
||||
mkdir -p /wizard && \
|
||||
if [ -z ${KASM_VERSION+x} ]; then \
|
||||
KASM_VERSION=$(curl -sX GET 'https://api.github.com/repos/kasmtech/kasm-install-wizard/releases' \
|
||||
| jq -r 'map(select(.prerelease)) | sort_by(.published_at) | last | .tag_name'); \
|
||||
KASM_VERSION=$(curl -sX GET https://kasm-ci.s3.amazonaws.com/dev-version.txt); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/wizard.tar.gz -L \
|
||||
"https://github.com/kasmtech/kasm-install-wizard/archive/refs/tags/${KASM_VERSION}.tar.gz" && \
|
||||
"https://github.com/kasmtech/kasm-install-wizard/tarball/feature/KASM-3512-gpu-option" && \
|
||||
tar xf \
|
||||
/tmp/wizard.tar.gz -C \
|
||||
/wizard --strip-components=1 && \
|
||||
|
|
@ -75,18 +80,19 @@ RUN \
|
|||
/ && \
|
||||
echo "**** copy assets ****" && \
|
||||
cp \
|
||||
/kasm_release/www/img/thumbnails/*.png \
|
||||
/kasm_release/www/img/thumbnails/*.png /kasm_release/www/img/thumbnails/*.svg \
|
||||
/wizard/public/img/thumbnails/ && \
|
||||
cp \
|
||||
/kasm_release/conf/database/seed_data/default_images_a* \
|
||||
/wizard/ && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
apt-get remove -y g++ gcc make && \
|
||||
apt-get -y autoremove && \
|
||||
apt-get clean && \
|
||||
rm -rf \
|
||||
/root/.npm \
|
||||
/root/.cache \
|
||||
/tmp/*
|
||||
/tmp/* \
|
||||
/var/lib/apt/lists/* \
|
||||
/var/tmp/*
|
||||
|
||||
# add init files
|
||||
COPY root/ /
|
||||
|
|
|
|||
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
|
|
@ -24,7 +24,7 @@ pipeline {
|
|||
DOCKERHUB_IMAGE = 'linuxserver/kasm'
|
||||
DEV_DOCKERHUB_IMAGE = 'lsiodev/kasm'
|
||||
PR_DOCKERHUB_IMAGE = 'lspipepr/kasm'
|
||||
DIST_IMAGE = 'alpine'
|
||||
DIST_IMAGE = 'ubuntu'
|
||||
MULTIARCH='true'
|
||||
CI='true'
|
||||
CI_WEB='true'
|
||||
|
|
@ -104,7 +104,7 @@ pipeline {
|
|||
steps{
|
||||
script{
|
||||
env.EXT_RELEASE = sh(
|
||||
script: ''' curl -sX GET 'https://api.github.com/repos/kasmtech/kasm-install-wizard/releases'| jq -r 'map(select(.prerelease)) | sort_by(.published_at) | last | .tag_name' ''',
|
||||
script: ''' curl -sX GET https://kasm-ci.s3.amazonaws.com/dev-version.txt ''',
|
||||
returnStdout: true).trim()
|
||||
env.RELEASE_LINK = 'custom_command'
|
||||
}
|
||||
|
|
|
|||
19
README.md
19
README.md
|
|
@ -80,6 +80,18 @@ Access the installation wizard at https://`your ip`:3000 and follow the instruct
|
|||
|
||||
Currently Synology systems are not supported due to them blocking CPU scheduling in their Kernel.
|
||||
|
||||
### GPU Support
|
||||
|
||||
During installation an option will be presented to force all Workspace containers to mount in and use a specific GPU. This option is meant for non NVIDIA GPUs only, if using an NVIDIA card please use the native support built into Kasm Workspaces and ensure you are running this container with the NVIDIA container runtime.
|
||||
|
||||
### Gamepad support
|
||||
|
||||
In order to properly create virtual Gamepads you will need to mount from your host `/dev/input` and `/run/udev/data`. Please see [HERE](https://www.kasmweb.com/docs/develop/guide/gamepad_passthrough.html) for instructions on enabling gamepad support.
|
||||
|
||||
### Persistant profiles
|
||||
|
||||
In order to use persistant profiles in Workspaces you will need to mount in a folder to use from your host to `/profiles`. From there when configuring a workspace you can set the `Persistant Profile Path` to IE `/profiles/ubuntu-focal/{username}/`, more infomation can be found [HERE](https://www.kasmweb.com/docs/latest/how_to/persistent_profiles.html).
|
||||
|
||||
## Usage
|
||||
|
||||
Here are some example snippets to help you get started creating a container.
|
||||
|
|
@ -102,6 +114,8 @@ services:
|
|||
volumes:
|
||||
- /path/to/data:/opt
|
||||
- /path/to/profiles:/profiles #optional
|
||||
- /dev/input:/dev/input #optional
|
||||
- /run/udev/data:/run/udev/data #optional
|
||||
ports:
|
||||
- 3000:3000
|
||||
- 443:443
|
||||
|
|
@ -122,6 +136,8 @@ docker run -d \
|
|||
-p 443:443 \
|
||||
-v /path/to/data:/opt \
|
||||
-v /path/to/profiles:/profiles `#optional` \
|
||||
-v /dev/input:/dev/input `#optional` \
|
||||
-v /run/udev/data:/run/udev/data `#optional` \
|
||||
--restart unless-stopped \
|
||||
lscr.io/linuxserver/kasm:develop
|
||||
```
|
||||
|
|
@ -140,6 +156,8 @@ Container images are configured using parameters passed at runtime (such as thos
|
|||
| `-e DOCKER_HUB_PASSWORD=PASS` | Optionally specify a DockerHub password to pull private images. |
|
||||
| `-v /opt` | Docker and installation storage. |
|
||||
| `-v /profiles` | Optionally specify a path for persistent profile storage. |
|
||||
| `-v /dev/input` | Optional for gamepad support. |
|
||||
| `-v /run/udev/data` | Optional for gamepad support. |
|
||||
|
||||
## Environment variables from files (Docker secrets)
|
||||
|
||||
|
|
@ -237,5 +255,6 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
|
|||
|
||||
## Versions
|
||||
|
||||
* **05.11.22:** - Rebase to Jammy, add support for GPUs, add support for Gamepads.
|
||||
* **23.09.22:** - Migrate to s6v3.
|
||||
* **02.07.22:** - Initial Release.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# jenkins variables
|
||||
project_name: docker-kasm
|
||||
external_type: na
|
||||
custom_version_command: "curl -sX GET 'https://api.github.com/repos/kasmtech/kasm-install-wizard/releases'| jq -r 'map(select(.prerelease)) | sort_by(.published_at) | last | .tag_name'"
|
||||
custom_version_command: "curl -sX GET https://kasm-ci.s3.amazonaws.com/dev-version.txt"
|
||||
release_type: prerelease
|
||||
release_tag: develop
|
||||
ls_branch: develop
|
||||
|
|
@ -15,7 +15,7 @@ repo_vars:
|
|||
- DOCKERHUB_IMAGE = 'linuxserver/kasm'
|
||||
- DEV_DOCKERHUB_IMAGE = 'lsiodev/kasm'
|
||||
- PR_DOCKERHUB_IMAGE = 'lspipepr/kasm'
|
||||
- DIST_IMAGE = 'alpine'
|
||||
- DIST_IMAGE = 'ubuntu'
|
||||
- MULTIARCH='true'
|
||||
- CI='true'
|
||||
- CI_WEB='true'
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ opt_param_env_vars:
|
|||
opt_param_usage_include_vols: true
|
||||
opt_param_volumes:
|
||||
- { vol_path: "/profiles", vol_host_path: "/path/to/profiles", desc: "Optionally specify a path for persistent profile storage." }
|
||||
- { vol_path: "/dev/input", vol_host_path: "/dev/input", desc: "Optional for gamepad support." }
|
||||
- { vol_path: "/run/udev/data", vol_host_path: "/run/udev/data", desc: "Optional for gamepad support." }
|
||||
|
||||
opt_param_usage_include_ports: false
|
||||
opt_param_ports: []
|
||||
|
|
@ -83,9 +85,22 @@ app_setup_block: |
|
|||
* admin@kasm.local
|
||||
* user@kasm.local
|
||||
|
||||
Currently Synology systems are not supported due to them blocking CPU scheduling in their Kernel.
|
||||
Currently Synology systems are not supported due to them blocking CPU scheduling in their Kernel.
|
||||
|
||||
### GPU Support
|
||||
|
||||
During installation an option will be presented to force all Workspace containers to mount in and use a specific GPU. This option is meant for non NVIDIA GPUs only, if using an NVIDIA card please use the native support built into Kasm Workspaces and ensure you are running this container with the NVIDIA container runtime.
|
||||
|
||||
### Gamepad support
|
||||
|
||||
In order to properly create virtual Gamepads you will need to mount from your host `/dev/input` and `/run/udev/data`. Please see [HERE](https://www.kasmweb.com/docs/develop/guide/gamepad_passthrough.html) for instructions on enabling gamepad support.
|
||||
|
||||
### Persistant profiles
|
||||
|
||||
In order to use persistant profiles in Workspaces you will need to mount in a folder to use from your host to `/profiles`. From there when configuring a workspace you can set the `Persistant Profile Path` to IE `/profiles/ubuntu-focal/{username}/`, more infomation can be found [HERE](https://www.kasmweb.com/docs/latest/how_to/persistent_profiles.html).
|
||||
|
||||
# changelog
|
||||
changelogs:
|
||||
- { date: "05.11.22:", desc: "Rebase to Jammy, add support for GPUs, add support for Gamepads." }
|
||||
- { date: "23.09.22:", desc: "Migrate to s6v3." }
|
||||
- { date: "02.07.22:", desc: "Initial Release." }
|
||||
|
|
|
|||
2
root/gpuinfo.sh
Executable file
2
root/gpuinfo.sh
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
#! /bin/bash
|
||||
drm_info -j 2>/dev/null| jq -c 'with_entries(.value |= .driver.desc)'
|
||||
Loading…
Add table
Add a link
Reference in a new issue