Coder Social home page Coder Social logo

ropenttd / docker_openttd Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 22.0 100 KB

๐Ÿš‚ OpenTTD in a container. Pure, plain, and simple.

License: GNU General Public License v3.0

Shell 59.34% Dockerfile 40.66%
docker docker-image game ghcr kubernetes oci-image openttd openttd-docker openttd-server

docker_openttd's People

Contributors

agrund avatar alemansec avatar duckfullstop avatar jamezjb avatar lionzxy avatar mijndert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker_openttd's Issues

config file overwritten on startup

Every time i startup the container my config files get overwritten. From looking at my mounted volumes,, the config files have been split up and changed location in the latest version from "/config" to "/config/.config". I couldn't find anything in the openttd documentation, but it seems to be happening.

openttd.cf and private,cfg are in ~/openttd
Here is the log from a startup:

$ ~/openttd/.config$ docker run --name openttd -it -p 3979:3979/tcp -p 3979:3979/udp -v ~/openttd:/config:rw -e loadgame=xxx.sav" redditopenttd/openttd:latest
**No config file found: generating one**
Loading /config/save/xxx.sav
dbg: [net] Starting dedicated server, version 13.0
dbg: [net] Starting network
dbg: [net] Initializing UDP listeners
dbg: [net] Network online, multiplayer available
dbg: [net] Detected broadcast addresses:
dbg: [net]   0) 172.17.255.255
[2023-03-30 21:07:03] OpenTTD Game Console Revision 7 - 13.0
[2023-03-30 21:07:03] ------------------------------------
[2023-03-30 21:07:03] use "help" for more information.
[2023-03-30 21:07:03]
[2023-03-30 21:07:03] dbg: [net] Initializing UDP listeners
[2023-03-30 21:07:03] dbg: [net] Initializing UDP listeners
[2023-03-30 21:07:03] dbg: [net] Listening on 0.0.0.0:3979 (IPv4)
[2023-03-30 21:07:03] dbg: [net] Listening on 0.0.0.0:3979 (IPv4)
[2023-03-30 21:07:03] dbg: [net] Network revision name: 13.0
[2023-03-30 21:07:03] โ€Ž*** Game still paused (manual, number of players)
[2023-03-30 21:07:04] dbg: [net] Connected to coordinator.openttd.org:3976
[2023-03-30 21:07:04] dbg: [net] Connected to stun.openttd.org:3975
[2023-03-30 21:07:07] dbg: [net] ----------------------------------------
[2023-03-30 21:07:07] dbg: [net] Your server is now registered with the Game Coordinator:
[2023-03-30 21:07:07] dbg: [net]   Game type:       Invite only
[2023-03-30 21:07:07] dbg: [net]   Connection type: Behind NAT
[2023-03-30 21:07:07] dbg: [net]   Invite code:     xxxxx
[2023-03-30 21:07:07] dbg: [net] ----------------------------------------

I suspect that changing line 7 in "entrypoint.sh" would resolve the issue:

_if [ ! -f /config/.config/openttd.cfg ]; then_

Config generation in entrypoint might be broken

when launching a new container I get no base config, the server just launches without it, testing the command to generate it with docker exec gives me this

openttd@30061a15533a:~$ timeout -t 3 openttd -D
timeout: invalid option -- 't'
Try 'timeout --help' for more information

UID and GID Specification

Good afternoon, thanks for the work on this container. Been running it without persistence for a bit and it's worked great. Recently I have been working to get it setup to utilize the config directory so it can resume from autosave however I am having trouble configuring it to run as a proper user that has permissions to the folder.

I am running Docker from my Synology NAS and have many other containers I run which generally take PUID and GUID or UID and GID property that can be set as an environment variables to specify the user. Looking through the documentation and code it doesn't appear this container supports that.

Any chance that could be added?

Config folder filled with game files

my docker run command is:
docker run -d --name openttd --restart=always -p 3979:3979/tcp -p 3979:3979/udp -e savegame=autosave -v ~/.openttd:/config:rw redditopenttd/openttd:latest

It runs fine, but instead of ~/.openttd having just a config file in it, it contains the base game files. screenshot: https://i.imgur.com/dyXPnrb.png

Is this intended? I can't find openttd.cfg anywhere, and it doesn't seem like this is intended.

/config/save/ not found...

Hi guys,

I'm really struggling to get this image to load a saved game. I'm fairly new to Docker so i'm probably doing something stupid. I'd really appreciate some help!

I'm running:
docker run -d --name openttd -p 3979:3979/tcp -p 3979:3979/udp -e savegame=autosave -v ~/.openttd:/config:rw redditopenttd/openttd:latest

Without the argument e loadgame=true the logs show:

loadgame not set - starting new game

...and then proceeds to generate a new map.

With -e loadgame=true in the command, if I look at the docker logs of the container, i'm just hitting the error:

/config/save/ not found...

If I remove both -e arguments, the container loads up and the openttd.cfg file that's being mounted is working as expected; the server is named correctly, with all the correct configuration and map size etc. I just can't find autosaves or explicit saved game files (e.g. -e savegame=mysavedgame.sav)

Things I've tried:

  1. I've ensured there is a /save/ folder within ~/.openttd folder that contains the .sav files.
  2. I've chown'd (root:root and robin:robin) and chmoded the hell out of everything in case it was permissions and ownership related.
  3. The .openttd folder that i'm mounting lives in my /home/robin/ user folder, and i've tried running docker as robin with sudo and as root.
  4. Explicitly loading just the openttd.cfg file and the save directory as two separate -v arguments as described in luaduck's latest readme commits.

Cheers,
Robin

Config File Version

Hi the server works so far, but I think it got the wrong version.
If I look into the generated config file I see the following under the VERSION section

[version]
version_string = 1.10.1
version_number = 1A086D64

This indicated a version from 2020 I assume, is this intended?
Greetings

Docker file for X11-forwarding

Hi,

As I understand this is only for the server mode?

How would you modify this to be able to play in Docker? I already have set up XQuartz, so I just need to get the build to also include everything that I need

Cheers

Container doesn't upgrade to newest version

My Container doesn't want to upgrade to the latest (13.3) Version of OpenTTD and instead stays at 13.1.
It doesn't matter if I use the latest/stable or testing tag.
I thought it would upgrade at least in some 24h windows.

save - file not writable

Hi I am trying to host this docker container and keep getting save issues.
I launch it using the following.

sudo docker run -it --rm -p 3979:3979/tcp -p 3979:3979/udp -v /home/admin/.openttd:/config --name openttd-NAB redditopenttd/openttd:latest

it keeps failing the save

[2021-05-19 17:06:40] dbg: [sl] Game Save Failed File not writable [2021-05-19 17:06:40] ERROR: Autosave failed

I have been playing with volume permissions etc but have not had any luck.

Supported Architectures

I went to run the container on a Pi 4, and realized that there is no ARM64 image for this container. Is there any plan to add support for this in the future?

My Files Land in wrong Place. .local/share/

The game search in

No config file found: generating one

ls: cannot access '/config/save/autosave/': No such file or directory

/config/save/autosave/ not found...

but the files and the save dictory lands in .local/share/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.