noppodev commited on
Commit
97bbf25
·
verified ·
1 Parent(s): 7f10a92

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -12
Dockerfile CHANGED
@@ -1,22 +1,23 @@
1
  FROM ubuntu:22.04
2
 
3
- # 必要な道具をインストール(curl, gnupg, nbd-server)
4
- RUN apt-get update && apt-get install -y curl gnupg nbd-server && apt-get clean
5
 
6
- # Tailscale公式ポジトリ追加してインストール
7
- RUN curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg | tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null && \
8
- curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.tailscale-keyring.list | tee /etc/apt/sources.list.d/tailscale.list && \
9
- apt-get update && apt-get install -y tailscale && apt-get clean
10
-
11
- # 16GBのメモリ領域(スワップ用ファイル)を作成
12
  RUN truncate -s 16G /tmp/memory_pool
13
 
14
- # NBDサーバーの設定を作成
 
15
  RUN mkdir -p /etc/nbd-server && \
16
- echo '[generic]\n user = root\n group = root\n[export]\n exportname = /tmp/memory_pool\n port = 7860' > /etc/nbd-server/config
 
 
 
 
 
17
 
18
- # Tailscaleを起動して接続しその後にNBDサーバー立ち上げる
19
  CMD tailscaled --tun=userspace-networking --socks5-server=localhost:1055 & \
20
  sleep 5 && \
21
- tailscale up --authkey=${TAILSCALE_AUTHKEY} --hostname=hf-memory && \
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 gnupg nbd-server tailscale && apt-get clean
5
 
6
+ # 16GBメモ領域作成
 
 
 
 
 
7
  RUN truncate -s 16G /tmp/memory_pool
8
 
9
+ # NBDの設定ファイル「/etc/nbd-server/config」に作成
10
+ # authfileを一旦外して、誰でも(Tailscale内なら)繋げるように簡略化するぜ
11
  RUN mkdir -p /etc/nbd-server && \
12
+ echo '[generic]\n\
13
+ user = root\n\
14
+ group = root\n\
15
+ [export]\n\
16
+ exportname = /tmp/memory_pool\n\
17
+ port = 7860' > /etc/nbd-server/config
18
 
19
+ # 起動スクリプト:Tailscaleを繋いでから、NBDをフォアグラウンドで動かす
20
  CMD tailscaled --tun=userspace-networking --socks5-server=localhost:1055 & \
21
  sleep 5 && \
22
+ tailscale up --authkey=${TAILSCALE_AUTHKEY} --hostname=hf-server && \
23
  nbd-server -d -C /etc/nbd-server/config