Skip to content

Commit 9406403

Browse files
committed
Minimal Dockerfile.
1 parent afe6b42 commit 9406403

7 files changed

Lines changed: 77 additions & 119 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.gitignore

docker.init.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
3+
# Setup ssh
4+
setup_ssh() {
5+
if [[ $PUBLIC_KEY ]]; then
6+
echo "Setting up SSH..."
7+
mkdir -p ~/.ssh
8+
echo "$PUBLIC_KEY" >> ~/.ssh/authorized_keys
9+
chmod 700 -R ~/.ssh
10+
11+
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
12+
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -q -N ''
13+
echo "RSA key fingerprint:"
14+
ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub
15+
fi
16+
17+
if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
18+
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -q -N ''
19+
echo "DSA key fingerprint:"
20+
ssh-keygen -lf /etc/ssh/ssh_host_dsa_key.pub
21+
fi
22+
23+
if [ ! -f /etc/ssh/ssh_host_ecdsa_key ]; then
24+
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -q -N ''
25+
echo "ECDSA key fingerprint:"
26+
ssh-keygen -lf /etc/ssh/ssh_host_ecdsa_key.pub
27+
fi
28+
29+
if [ ! -f /etc/ssh/ssh_host_ed25519_key ]; then
30+
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -q -N ''
31+
echo "ED25519 key fingerprint:"
32+
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
33+
fi
34+
35+
service ssh start
36+
37+
echo "SSH host keys:"
38+
for key in /etc/ssh/*.pub; do
39+
echo "Key: $key"
40+
ssh-keygen -lf $key
41+
done
42+
fi
43+
}
44+
45+
setup_ssh
46+
service ssh start
47+
sleep infinity

resources/docker/Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#To build, run
2+
# docker build -t <image-name> . -f resources/docker/Dockerfile
3+
# docker tag <image-name> <dockerhub-username>/<repository-name>:<tag>
4+
# docker push <dockerhub-username>/<repository-name>:<tag>
5+
6+
FROM --platform=linux/amd64 ubuntu:22.04
7+
8+
ENV OT_PLATFORM=cuda
9+
ENV OT_SCRIPT_DEBUG=true
10+
ENV PATH=/root/.pixi/bin:${PATH}
11+
ENV TZ=Etc/UTC
12+
13+
WORKDIR /
14+
RUN apt-get update && \
15+
apt-get install -y \
16+
git \
17+
curl \
18+
ssh
19+
ADD . /OneTrainer
20+
21+
RUN cd OneTrainer \
22+
&& export OT_PLATFORM=cuda \
23+
&& export OT_SCRIPT_DEBUG=true \
24+
&& ./install.sh \
25+
&& rm -rf /root/.cache \
26+
&& mkdir -p /workspace \
27+
&& ln -s /OneTrainer /workspace/OneTrainer
28+
29+
ENTRYPOINT [ "/usr/bin/bash /docker.init.sh" ]

resources/docker/NVIDIA-UI.Dockerfile

Lines changed: 0 additions & 45 deletions
This file was deleted.

resources/docker/RunPod-NVIDIA-CLI-start.sh.patch

Lines changed: 0 additions & 8 deletions
This file was deleted.

resources/docker/RunPod-NVIDIA-CLI.Dockerfile

Lines changed: 0 additions & 34 deletions
This file was deleted.

resources/docker/Vast-NVIDIA-CLI.Dockerfile

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)