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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -8
Dockerfile CHANGED
@@ -1,22 +1,27 @@
1
  FROM ubuntu:22.04
2
 
3
- # 必要なもの全部入れる(openssh-serverを追加だぜ)
4
- RUN apt-get update && apt-get install -y nbd-server tailscale openssh-server && apt-get clean
5
 
6
- # 16GBの領域確保
 
 
 
 
7
  RUN truncate -s 16G /tmp/memory_pool
8
 
9
- # SSHの設定(パスワードなしでログインできるようにするぜ
10
- RUN mkdir /var/run/sshd && echo 'root:noppo' | chpasswd && \
 
11
  sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
12
 
13
- # NBDの設定
14
  RUN mkdir -p /etc/nbd-server && \
15
  echo '[generic]\n user = root\n group = root\n[export]\n exportname = /tmp/memory_pool\n port = 7860' > /etc/nbd-server/config
16
 
17
- # 起動:Tailscaleを繋ぎ、SSHNBDを立ち上げる
18
  CMD tailscaled --tun=userspace-networking & \
19
  sleep 5 && \
20
  tailscale up --authkey=${TAILSCALE_AUTHKEY} --hostname=hf-server && \
21
- service ssh start && \
22
  nbd-server -d -C /etc/nbd-server/config
 
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