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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -12
Dockerfile CHANGED
@@ -1,22 +1,20 @@
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 && \
 
1
  FROM ubuntu:22.04
2
 
3
+ # 1. 必要な道具インストールとTailscaleのセットアップを一つの命令にまとめるぜ
4
+ RUN apt-get update && apt-get install -y curl gnupg nbd-server && \
5
+ curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.noarmor.gpg | tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null && \
6
+ curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/jammy.tailscale-keyring.list | tee /etc/apt/sources.list.d/tailscale.list && \
7
+ apt-get update && apt-get install -y tailscale && \
8
+ apt-get clean
9
 
10
+ # 2. 16GBの領域確保
11
  RUN truncate -s 16G /tmp/memory_pool
12
 
13
+ # 3. 設定ファイル作成
 
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
+ # 4. 起動
18
  CMD tailscaled --tun=userspace-networking --socks5-server=localhost:1055 & \
19
  sleep 5 && \
20
  tailscale up --authkey=${TAILSCALE_AUTHKEY} --hostname=hf-server && \