noppodev commited on
Commit
a98782c
·
verified ·
1 Parent(s): 091d16b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -11
Dockerfile CHANGED
@@ -1,27 +1,30 @@
1
  FROM ubuntu:22.04
2
 
3
- # 必要な基本ツールだけを入れる
4
- RUN apt-get update && apt-get install -y curl nbd-server openssh-server && apt-get clean
5
 
6
- # Tailscaleを公式スクリプトで一発インストール
7
- # これならリポジトリ登録の手間がないぜ
8
  RUN curl -fsSL https://tailscale.com/install.sh | sh
9
 
10
- # 16GBのメモリプールを作成
11
  RUN truncate -s 16G /tmp/memory_pool
12
 
13
- # SSHの設定(rootログインとパスワードを許可)
14
  RUN mkdir /var/run/sshd && \
15
  echo 'root:noppo' | chpasswd && \
16
- sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
 
17
 
18
- # NBDの設定ファイル作成
19
  RUN mkdir -p /etc/nbd-server && \
20
- echo '[generic]\n user = root\n group = root\n[export]\n exportname = /tmp/memory_pool\n port = 7860' > /etc/nbd-server/config
21
 
22
- # 起動シーケンスTailscale -> SSH -> NBD
 
23
  CMD tailscaled --tun=userspace-networking & \
24
  sleep 5 && \
25
  tailscale up --authkey=${TAILSCALE_AUTHKEY} --hostname=hf-server && \
26
  /usr/sbin/sshd && \
27
- nbd-server -d -C /etc/nbd-server/config
 
 
 
1
  FROM ubuntu:22.04
2
 
3
+ # 1. 必要なツールを全部入れる(python3を追加だぜ)
4
+ RUN apt-get update && apt-get install -y curl nbd-server openssh-server python3 && apt-get clean
5
 
6
+ # 2. Tailscaleをインストール
 
7
  RUN curl -fsSL https://tailscale.com/install.sh | sh
8
 
9
+ # 3. 16GBの領域確保
10
  RUN truncate -s 16G /tmp/memory_pool
11
 
12
+ # 4. SSHの設定
13
  RUN mkdir /var/run/sshd && \
14
  echo 'root:noppo' | chpasswd && \
15
+ sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
16
+ sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
17
 
18
+ # 5. NBDの設定ファイル
19
  RUN mkdir -p /etc/nbd-server && \
20
+ echo '[generic]\n user = root\n group = root\n[export]\n exportname = /tmp/memory_pool\n port = 7861' > /etc/nbd-server/config
21
 
22
+ # 6. 起動:偽のWebサーバー(ポート7860)とNBD(ポート7861)を両方動かすぜ
23
+ # Hugging Faceは7860に反応があれば満足するんだ
24
  CMD tailscaled --tun=userspace-networking & \
25
  sleep 5 && \
26
  tailscale up --authkey=${TAILSCALE_AUTHKEY} --hostname=hf-server && \
27
  /usr/sbin/sshd && \
28
+ nbd-server -C /etc/nbd-server/config & \
29
+ echo "Starting fake web server on 7860..." && \
30
+ python3 -m http.server 7860