Charan5775 commited on
Commit
1ef60c5
·
verified ·
1 Parent(s): 4ccd4e0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +117 -24
Dockerfile CHANGED
@@ -1,31 +1,124 @@
1
- FROM ubuntu:20.04
2
 
3
- # Set environment variables to allow non-interactive installation
4
- ENV DEBIAN_FRONTEND=noninteractive
5
 
6
- # Install necessary dependencies
7
- RUN apt-get update && apt-get install -y \
8
- curl \
9
- sudo \
10
- wget
 
11
 
12
- # Create a non-root user and add it to the sudo group
13
- RUN useradd -m -s /bin/bash -G sudo user && \
14
- echo "user:user" | chpasswd
15
 
16
- # Switch to the non-root user
17
- USER user
18
- WORKDIR /home/user
19
 
20
- RUN curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.17.0.7f020d.tar.gz && \
21
- tar -xf kasm_release_1.17.0.7f020d.tar.gz
22
- # Download and extract Kasm
23
- #RUN wget https://kasm-static-content.s3.amazonaws.com/kasm_release_1.17.0.7f020d.tar.gz && \
24
- # tar -xf kasm_release_1.14.0.652298.tar.gz
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
- # Expose the Kasm web interface port
27
- EXPOSE 3000
28
- #sudo ./kasm_release/install.sh -e --install-profile noninteractive --admin-password topsecret
29
 
30
- # Start the Kasm installation
31
- CMD ["sudo", "/home/user/kasm_release/install.sh","-e","noninteractive","-S","--admin-password","topsecret"]
 
 
1
+ # syntax=docker/dockerfile:1
2
 
3
+ FROM ghcr.io/linuxserver/baseimage-ubuntu:noble
 
4
 
5
+ # set version label
6
+ ARG BUILD_DATE
7
+ ARG KASM_VERSION
8
+ ARG VERSION
9
+ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
10
+ LABEL maintainer="thespad"
11
 
12
+ # Env
13
+ ENV DOCKER_TLS_CERTDIR=""
14
+ ENV TINI_SUBREAPER=true
15
 
16
+ #Add needed nvidia environment variables for https://github.com/NVIDIA/nvidia-docker
17
+ ENV NVIDIA_DRIVER_CAPABILITIES="compute,graphics,video,utility"
 
18
 
19
+ # Container setup
20
+ RUN \
21
+ echo "**** install packages ****" && \
22
+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
23
+ echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu noble stable" > \
24
+ /etc/apt/sources.list.d/docker.list && \
25
+ curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
26
+ && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
27
+ sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
28
+ tee /etc/apt/sources.list.d/nvidia-container-toolkit.list && \
29
+ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
30
+ echo "Package: docker-ce docker-ce-cli docker-ce-rootless-extras \
31
+ Pin: version 5:28.* \
32
+ Pin-Priority: 1001" > /etc/apt/preferences.d/docker && \
33
+ apt-get install -y --no-install-recommends \
34
+ btrfs-progs \
35
+ build-essential \
36
+ containerd.io \
37
+ docker-ce \
38
+ docker-ce-cli \
39
+ docker-compose-plugin \
40
+ e2fsprogs \
41
+ fuse-overlayfs \
42
+ iproute2 \
43
+ iptables \
44
+ lsof \
45
+ nodejs \
46
+ nvidia-container-toolkit \
47
+ openssl \
48
+ pigz \
49
+ python3 \
50
+ sudo \
51
+ uidmap \
52
+ xfsprogs && \
53
+ echo "**** dind setup ****" && \
54
+ useradd -U dockremap && \
55
+ usermod -G dockremap dockremap && \
56
+ echo 'dockremap:165536:65536' >> /etc/subuid && \
57
+ echo 'dockremap:165536:65536' >> /etc/subgid && \
58
+ curl -o \
59
+ /usr/local/bin/dind -L \
60
+ https://raw.githubusercontent.com/moby/moby/master/hack/dind && \
61
+ chmod +x /usr/local/bin/dind && \
62
+ echo 'hosts: files dns' > /etc/nsswitch.conf && \
63
+ echo "**** setup wizard ****" && \
64
+ mkdir -p /wizard && \
65
+ if [ -z ${KASM_VERSION+x} ]; then \
66
+ KASM_VERSION=$(curl -sX GET 'https://api.github.com/repos/kasmtech/kasm-install-wizard/releases/latest' \
67
+ | jq -r '.name'); \
68
+ fi && \
69
+ echo "${KASM_VERSION}" > /version.txt && \
70
+ curl -o \
71
+ /tmp/wizard.tar.gz -L \
72
+ "https://github.com/kasmtech/kasm-install-wizard/archive/refs/tags/${KASM_VERSION}.tar.gz" && \
73
+ tar xf \
74
+ /tmp/wizard.tar.gz -C \
75
+ /wizard --strip-components=1 && \
76
+ cd /wizard && \
77
+ npm install && \
78
+ echo "**** add installer ****" && \
79
+ curl -o \
80
+ /tmp/kasm.tar.gz -L \
81
+ "https://github.com/kasmtech/kasm-install-wizard/releases/download/${KASM_VERSION}/kasm_release.tar.gz" && \
82
+ tar xf \
83
+ /tmp/kasm.tar.gz -C \
84
+ / && \
85
+ ALVERSION=$(cat /kasm_release/conf/database/seed_data/default_properties.yaml |awk '/alembic_version/ {print $2}') && \
86
+ curl -o \
87
+ /tmp/images.tar.gz -L \
88
+ "https://kasm-ci.s3.amazonaws.com/${KASM_VERSION}-images-combined.tar.gz" && \
89
+ tar xf \
90
+ /tmp/images.tar.gz -C \
91
+ / && \
92
+ sed -i \
93
+ '/alembic_version/s/.*/alembic_version: '${ALVERSION}'/' \
94
+ /kasm_release/conf/database/seed_data/default_images_a* && \
95
+ sed -i 's/-N -e -H/-N -B -e -H/g' /kasm_release/upgrade.sh && \
96
+ echo "exit 0" > /kasm_release/install_dependencies.sh && \
97
+ /kasm_release/bin/utils/yq_$(uname -m) -i \
98
+ '.services.proxy.volumes += "/kasm_release/www/img/thumbnails:/srv/www/img/thumbnails"' \
99
+ /kasm_release/docker/docker-compose-all.yaml && \
100
+ echo "**** copy assets ****" && \
101
+ cp \
102
+ /kasm_release/www/img/thumbnails/*.png /kasm_release/www/img/thumbnails/*.svg \
103
+ /wizard/public/img/thumbnails/ && \
104
+ cp \
105
+ /kasm_release/conf/database/seed_data/default_images_a* \
106
+ /wizard/ && \
107
+ useradd -u 70 kasm_db && \
108
+ useradd kasm && \
109
+ printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
110
+ echo "**** cleanup ****" && \
111
+ apt-get remove -y g++ gcc make && \
112
+ apt-get -y autoremove && \
113
+ apt-get clean && \
114
+ rm -rf \
115
+ /tmp/* \
116
+ /var/lib/apt/lists/* \
117
+ /var/tmp/*
118
 
119
+ # add init files
120
+ COPY root/ /
 
121
 
122
+ # Ports and volumes
123
+ EXPOSE 3000 443
124
+ VOLUME /opt/