Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +12 -8
Dockerfile
CHANGED
|
@@ -1,19 +1,23 @@
|
|
| 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
|
| 8 |
-
truncate -s 16G $fallback_file
|
| 9 |
|
| 10 |
-
#
|
| 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
|
|
|
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM ubuntu:22.04
|
| 2 |
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y nbd-server && apt-get clean
|
| 4 |
|
| 5 |
+
# 16GBの領域確保
|
| 6 |
+
RUN truncate -s 16G /tmp/memory_pool
|
|
|
|
| 7 |
|
| 8 |
+
# 0.0.0.0で全方位から受け付ける設定
|
| 9 |
RUN echo '[generic]\n\
|
| 10 |
user = root\n\
|
| 11 |
group = root\n\
|
| 12 |
[export]\n\
|
| 13 |
exportname = /tmp/memory_pool\n\
|
| 14 |
+
port = 7860\n\
|
| 15 |
+
authfile = /etc/nbd-server/allow' > /etc/nbd-server/config
|
| 16 |
|
| 17 |
+
# 誰でも接続OKにする(とりあえずテスト用)
|
| 18 |
+
RUN touch /etc/nbd-server/allow && echo "0.0.0.0/0" > /etc/nbd-server/allow
|
| 19 |
+
|
| 20 |
+
# 7860ポートを強制的に開放
|
| 21 |
+
EXPOSE 7860
|
| 22 |
+
|
| 23 |
+
CMD ["nbd-server", "-d", "-C", "/etc/nbd-server/config"]
|