Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +14 -5
Dockerfile
CHANGED
|
@@ -1,13 +1,22 @@
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
RUN apt-get update && apt-get install -y nbd-server
|
| 5 |
|
| 6 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
RUN truncate -s 16G /tmp/memory_pool
|
| 8 |
-
RUN echo '[generic]\n user = root\n group = root\n[export]\n exportname = /tmp/memory_pool\n port = 7860' > /etc/nbd-server/config
|
| 9 |
|
| 10 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
CMD tailscaled --tun=userspace-networking --socks5-server=localhost:1055 & \
|
|
|
|
| 12 |
tailscale up --authkey=${TAILSCALE_AUTHKEY} --hostname=hf-memory && \
|
| 13 |
nbd-server -d -C /etc/nbd-server/config
|
|
|
|
| 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
|