File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ .gitignore
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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" ]
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments