File size: 1,256 Bytes
3c6a4f6
 
a98782c
 
3c6a4f6
a98782c
091d16b
 
a98782c
22312ae
3c6a4f6
a98782c
091d16b
 
a98782c
 
5cbdc2c
a98782c
7f10a92
a98782c
7f10a92
a98782c
 
5cbdc2c
7f10a92
97bbf25
091d16b
a98782c
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM ubuntu:22.04

# 1. 必要なツールを全部入れる(python3を追加だぜ)
RUN apt-get update && apt-get install -y curl nbd-server openssh-server python3 && apt-get clean

# 2. Tailscaleをインストール
RUN curl -fsSL https://tailscale.com/install.sh | sh

# 3. 16GBの領域確保
RUN truncate -s 16G /tmp/memory_pool

# 4. SSHの設定
RUN mkdir /var/run/sshd && \
    echo 'root:noppo' | chpasswd && \
    sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
    sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config

# 5. NBDの設定ファイル
RUN mkdir -p /etc/nbd-server && \
    echo '[generic]\n  user = root\n  group = root\n[export]\n  exportname = /tmp/memory_pool\n  port = 7861' > /etc/nbd-server/config

# 6. 起動:偽のWebサーバー(ポート7860)とNBD(ポート7861)を両方動かすぜ
# Hugging Faceは7860に反応があれば満足するんだ
CMD tailscaled --tun=userspace-networking & \
    sleep 5 && \
    tailscale up --authkey=${TAILSCALE_AUTHKEY} --hostname=hf-server && \
    /usr/sbin/sshd && \
    nbd-server -C /etc/nbd-server/config & \
    echo "Starting fake web server on 7860..." && \
    python3 -m http.server 7860