Re:Readme

PCトラブルや環境構築、家電量販店とかで買ったもののメモ。ご利用は自己責任で。

Raspberry Pi 3にDockerをインストールする

Docker環境でMinecraftサーバを立てる記事を見つけたので、いろいろ試してみた。
ただし、結論から言えばRaspberry Pi 3においてDocker上でMinecraftサーバを立てる作業はうまくいかなかった。Docker自体は動いたのでその作業だけ記録する。

事前に用意しておく環境

OSはこの際64bit版へ移行。
www.raspberrypi.com
www.mikan-tech.net

Lite版はサーバ用途に必要な最低限の構成とのこと。Lite版でもよいが、無くて困ることはあっても、あって困ることは容量の浪費ぐらいしかないと考え、今回はDesktop版を使用。

あとは過去記事を参照。
hal-drumas.hatenablog.com

Dockerのインストール

Dockerでの構築を試してみる。
dev.classmethod.jp

参考文献で使用しているnginxの代わりにhello-worldで動作確認を実施。下記のように出力されたのでうまくいっていそう。

$ sudo docker run --name hello -it hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(arm64v8)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

Docker-Composeのインストール

GitHubはこちら。
github.com

下記の記事のバージョン部分を、本記事執筆時点の最新版であるv2.2.3に置き換えて作業を実施。
tkyonezu.com

Minecraftサーバ(統合版)のDockerイメージの取得・実行(失敗)

結局Minecraftサーバの実行はうまく行っていないが、作業の記録だけ残す。

GitHubはこちら。
github.com

また、参考文献は下記。
qiita.com

$ docker compose up --build --no-start
[+] Running 12/12
⠿ bds Pulled 139.5s
⠿ 0c6b8ff8c37e Pull complete 92.8s
⠿ 1d04c856e952 Pull complete 102.9s
⠿ 1d28e3f25c6a Pull complete 104.0s
⠿ a11ece0304d9 Pull complete 118.2s
⠿ 29c581f741c3 Pull complete 124.5s
⠿ 2f477f8b9948 Pull complete 127.9s
⠿ 5b785396eea2 Pull complete 129.0s
⠿ 932bc5e5474e Pull complete 131.1s
⠿ 811257bcf1e8 Pull complete 133.2s
⠿ 4f8f8a5b12c7 Pull complete 134.0s
⠿ 45e6cbdbd6fd Pull complete 134.8s
[+] Running 3/3
⠿ Network minecraft_default Created 2.6s
⠿ Volume "minecraft_bds" Created 0.0s
⠿ Container minecraft-bds-1 Created 11.7s
$ docker compose start
[+] Running 1/1
⠿ Container minecraft-bds-1 Started 6.9s

セットアップはうまくいっているっぽかったが、コンテナの動作状況を見ていると、exitedとなっていた。

$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0a1b88bbf37a itzg/minecraft-bedrock-server "/usr/local/bin/entr…" 4 minutes ago Exited (1) About a minute ago minecraft-bds-1

ログを見ると、下記のような表示が。

$ docker logs minecraft-bds-1
standard_init_linux.go:228: exec user process caused: exec format error

どうやら、itzg/minecraft-bedrock-serverはAMDのCPUでは動作しないらしい。エミュレータを用いる方法が登場するが、別のやり方を試したほうが早そうだったので、Docker上にサーバを立てる方法は断念。
github.com