安装docker
新建文件 touch docker_install.sh
vi docker_install.sh 编辑文件
输入i
复制粘贴下面的内容
============================
#!/bin/bash
COLOR="echo -e \\033[1;31m"
END="\033[m"
VERSION="19.03.5-3.el7"
wget -P /etc/yum.repos.d/ https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo || { {COLOR}"互联网连接失败,请检查网络配置!"{END};exit; }
yum clean all
yum -y install docker-ce-VERSION docker-ce-cli-VERSION || { {COLOR}"Base,Extras的yum源失败,请检查yum源配置"{END};exit; }
mkdir -p /etc/docker
cat > /etc/docker/daemon.json <<EOF
{
"registry-mirrors": ["https://7phikgwg.mirror.aliyuncs.com"]
}
EOF
systemctl enable --now docker
docker version && {COLOR}"Docker安装成功"{END} || {COLOR}"Docker安装失败"{END}
====================运行文件
Exc :wq保存
bash docker_install.sh
docker pull thijsvanloef/palworld-server-docker
创建目录
mkdir PalWorld
运行
docker run -d \
--name palworld-server \
-p 8211:8211/udp \
-p 27015:27015/udp \
-v /root/PalWorld:/palworld/ \
-e PLAYERS=16 \
-e PORT=8211 \
-e PUID=1000 \
-e PGID=1000 \
-e COMMUNITY=false \
--restart unless-stopped \
thijsvanloef/palworld-server-docker
停止
docker stop palworld-server
修改配置文件
vim /root/PalWorld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
重启
docker restart palworld-server