Update the readme with new instructions

Now with a cmd entrypoint the script will run the server when you run the container.
This commit is contained in:
Tranko 2022-01-04 11:34:45 +00:00 committed by GitHub
parent e8d983ba1e
commit e29b44abed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 29 deletions

View File

@ -36,46 +36,35 @@ If you use docker:
## Execute the container
### First step is to execute the container, it can be done in two ways depending of the networking configuration:
If you don't have the CNI network configured, you can use this command to execute the container.
### First step configure the env.world file:
podman run --name valheim --network host -v /home/pi/valheim_data:/root/valheim_data:rw -it valheim-base:v1 /bin/bash
This values don't be changed. Only if they change in the future:
If you have the CNI network configured you can use this command to execute the container:
STEAMAPPID=892970
BOX64_LD_LIBRARY_PATH=./linux64:/root/steam/linux32:$BOX64_LD_LIBRARY_PATH
BOX64_LOG=1
BOX64_TRACE_FILE=/root/valheim_data/output.log
BOX64_TRACE=1
podman run --rm --name valheim --network cni-podman1 -p 2456-2458:2456-2458/udp -v /home/pi/valheim_data:/root/valheim_data:rw -it valheim-base /bin/bash
This values are the real ones for yoru server:
If you use docker (I didn't test with cni network):
PUBLIC=0 # 0 private / 1 public
PORT=2456 # Don't change if don't know what are you doing.
NAME=YourServerName # Your amazing name of your server.
WORLD=YourWorldName # Your unique name of your world.
SAVEDIR=/root/valheim_data # Where to save your data.
PASSWORD=YourUniquePassw0rd # You can leave blank and it will not have password, not recommended for public servers.
docker run --rm --name valheim --network host -v /home/pi/valheim_data:/root/valheim_data:rw -it valheim-base /bin/bash
### Second step, run the container (example with Docker):
### Second step:
Create a start.sh copy from the start_server.sh and modify the execution with box64 in front.
For example I execute my server with the next line to create a local network server to play at home.
Also, as I had a previous world created, I connected it with a volumne in the execution of the container, so you can use "-savedir" to point to the world data:
nano start_server.sh
Modify the line of the execution of the server with your properties:
box64 ./valheim_server.x86_64 -public 0 -nographics -batchmode -name "Your server Name" -port 2456 -world "Your Workd Name" -savedir "/root/valheim_data"
Then, use Control + S and Control + X to save and exit the file
### Third step
Start the server with the command:
./start_server.sh
### Fourth step:
Stop the server with control + c as a the normal Valheim server.
docker run --rm --name valheim -p 2456-2457:2456-2457/udp -v /home/pi/ssd/valheim_data:/root/valheim_data:rw --env-file env.tardis valheim-base
## Considerations:
Pi4 has a limited hardware, it this is emulating x86_64 over arm64, so don't expect so high performance. It works, I didn't have any problems playing some hours.
When the game saves it freeze all connections during some seconds, take it into account!!!!! Several times it does not start correctly and fail (the emulator is not yet finished and it does not work all the times). In that cases, you need to stop the process killing the process.
## This experiment can be done for the next projects:
- [podman](podman.io)
- [docker](docker.com)
- [box86](https://github.com/ptitSeb/box86)
- [box64](https://github.com/ptitSeb/box64)
- [docker](docker.com)
- [podman](podman.io)