noppodev commited on
Commit
3c6a4f6
·
verified ·
1 Parent(s): 0a163ff

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -0
Dockerfile ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ # 必要な道具(NBD:ネットワーク越しにデバイスを繋ぐ仕組み)をインストール
4
+ RUN apt-get update && apt-get install -y nbd-server && apt-get clean
5
+
6
+ # 16GBの「空のファイル」を作って、そこをメモリ貸し出し所にするぜ
7
+ RUN fallback_file="/tmp/memory_pool" && \
8
+ truncate -s 16G $fallback_file
9
+
10
+ # Hugging Faceのポートルールに合わせて、外部から接続できるように設定
11
+ RUN echo '[generic]\n\
12
+ user = root\n\
13
+ group = root\n\
14
+ [export]\n\
15
+ exportname = /tmp/memory_pool\n\
16
+ port = 7860' > /etc/nbd-server/config
17
+
18
+ # サーバー起動!
19
+ CMD ["nbd-server", "-C", "/etc/etc/nbd-server/config"]