-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
129 lines (125 loc) · 4.36 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
FROM ubuntu:jammy
# Settings
ARG OVERLAY_VERSION="v2.2.0.3"
ARG RELEASE_TYPE="develop"
ENV DOCKER_TLS_CERTDIR=""
# Container setup
RUN \
echo "**** install packages ****" && \
apt-get update && \
apt-get install -y \
curl \
gnupg && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
ARCH=$(uname -m | sed 's/x86_64/amd64/g' |sed 's/aarch64/arm64/g') && \
echo "deb [arch=${ARCH}] 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_18.x | bash - && \
apt-get install -y --no-install-recommends \
bash \
btrfs-progs \
containerd.io \
docker-ce \
docker-ce-cli \
drm-info \
e2fsprogs \
fuse-overlayfs \
g++ \
gcc \
iptables \
jq \
lsof \
make \
nodejs \
nvidia-docker2 \
openssl \
pigz \
python3 \
sudo \
uidmap \
xfsprogs && \
echo "**** compose install ****" && \
mkdir -p /usr/local/lib/docker/cli-plugins && \
curl -L \
https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-$(uname -s)-$(uname -m) -o \
/usr/local/lib/docker/cli-plugins/docker-compose && \
chmod +x /usr/local/lib/docker/cli-plugins/docker-compose && \
echo "**** dind setup ****" && \
useradd -U dockremap && \
usermod -G dockremap dockremap && \
echo 'dockremap:165536:65536' >> /etc/subuid && \
echo 'dockremap:165536:65536' >> /etc/subgid && \
curl -o \
/usr/local/bin/dind -L \
https://raw.githubusercontent.com/moby/moby/master/hack/dind && \
chmod +x /usr/local/bin/dind && \
echo 'hosts: files dns' > /etc/nsswitch.conf && \
echo "**** setup init ****" && \
curl -o \
/tmp/s6-overlay-installer -L \
https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-$(uname -m | sed 's/x86_64/amd64/g')-installer && \
chmod +x /tmp/s6-overlay-installer && \
/tmp/s6-overlay-installer / && \
echo "**** setup wizard ****" && \
mkdir -p /wizard && \
if [ "${RELEASE_TYPE}" = "develop" ]; then \
KASM_VERSION=$(curl -sX GET https://kasm-ci.s3.amazonaws.com/dev-version.txt); \
fi; \
if [ "${RELEASE_TYPE}" = "stable" ]; then \
KASM_VERSION=$(curl -sX GET 'https://api.github.com/repos/kasmtech/kasm-install-wizard/releases/latest' \
| jq -r '.name'); \
fi; \
echo "${KASM_VERSION}" > /version.txt && \
curl -o \
/tmp/wizard.tar.gz -L \
"https://github.com/kasmtech/kasm-install-wizard/archive/refs/tags/${KASM_VERSION}.tar.gz" && \
tar xf \
/tmp/wizard.tar.gz -C \
/wizard --strip-components=1 && \
cd /wizard && \
npm install && \
echo "**** add installer ****" && \
curl -o \
/tmp/kasm.tar.gz -L \
"https://github.com/kasmtech/kasm-install-wizard/releases/download/${KASM_VERSION}/kasm_release.tar.gz" && \
tar xf \
/tmp/kasm.tar.gz -C \
/ && \
ALVERSION=$(cat /kasm_release/conf/database/seed_data/default_properties.yaml |awk '/alembic_version/ {print $2}') && \
curl -o \
/tmp/images.tar.gz -L \
"https://kasm-ci.s3.amazonaws.com/1.15.0-images-combined.tar.gz" && \
tar xf \
/tmp/images.tar.gz -C \
/ && \
sed -i \
'/alembic_version/s/.*/alembic_version: '${ALVERSION}'/' \
/kasm_release/conf/database/seed_data/default_images_a* && \
sed -i 's/-N -e -H/-N -B -e -H/g' /kasm_release/upgrade.sh && \
echo "exit 0" > /kasm_release/install_dependencies.sh && \
echo "**** copy assets ****" && \
cp \
/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 ****" && \
apt-get remove -y g++ gcc make && \
apt-get -y autoremove && \
apt-get clean && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# add init files
COPY root/ /
# Ports volumes and init
EXPOSE 3000 443
VOLUME /opt/
ENTRYPOINT ["/init"]