THIS IS NO LONGER MAINTAINED - PLEASE USE GODOT TEMPLATE REPOSITORY: https://github.com/PanLabGameDev/godot-boilerplate
This is work in progress!
UPDATE: 2018-10-08 - There is a precompiled headless server binary now. I am updating this docker repository to use the latest binaries: godot v3.0.6
UPDATE: 2018-07-01 - There is a precompiled server binary now. I am updating this docker repository to use the latest binaries: godot v3.0.4
UPDATE: 2018-02-27 - I just found out, that it is not possible to export a game using the headless server plattform due to the lack of a GPU or any GPU access on such a server. That's why i decided to postpone any further developement of this docker image until this is made available. This docker image can still be used to build and run the headless server - as well as, with small modifications of the build-godot.sh file, build the godot editor from the latest source for windows and linux.
Also this is my first steps in docker - feel free to submit changes :)
Use this docker image script to create a working build environment for Godot v3
At the moment it is possible to:
- compile godot v3 from source
- for platforms: headless linux server, X11, windows, javascript
- export your godot game for those plattforms NOT YET
- run your game from headless godot server within the docker container
What is not possible right now:
- export to Android
- immediately understand how it works by reading this help file
What will never be possible:
- compile to OSX
- export to any other Apple thing
- actually understand how it works by repeatingly reading this help file
Docker image is based on ubuntu:bionic. It installs all packets used for building and exporting godot binaries.
The Image will clone the godot source and will initially download the export templates.
There are several shell scripts available.
Run from outside:
build-docker.sh
.. starting point for creating the docker image.run-docker.sh [portnumber]
.. run your created docker image and create a container.
Runs during build process:
download-godot.sh [editor|templates|all]
.. downloads latest godot editor and export templatesinstall-emscripten.sh
.. installs and setup emscript
Run on active container (docker run ..):
build-godot.sh [editor|templates|all] [all|server|linux|windows|javascript]
.. builds the godot editor binary, or the export templates - takes a looong time.export-game.sh <game-name>
.. exports binaries for your mounted godot game directoryrun-game.sh <path-to-server-scene.tscn>
.. runs a scene on the headless server within your game directory
THIS IS OUTDATED - PLEASE USE docker-compose below
Run command to temporary build container and run your godot game within a headless server:
docker run --rm -it -p 8910 -v `pwd`:/root/workspace/game/ h4de5/docker-godot-3-build-and-run:latest /root/workspace/build-scripts/run-game.sh <path-to-server-scene.tscn>
Run command to temporary build container and export your game to windows/linux/javascript - binaries will be placed in /bin/ directory:
docker run --rm -it -v `pwd`:/root/workspace/game/ h4de5/docker-godot-3-build-and-run:latest /root/workspace/build-scripts/export-game.sh <name-your-game>
If you want to have a permanent container file:
docker run -it -v `pwd`:/root/workspace/game/ h4de5/docker-godot-3-build-and-run:latest bash
Reconnect to an permanent container file
docker exec -it docker-godot-3-build-and-run bash
For more information please see help (-h) for each script.
Have a look at the .env.dist
- modify paths and names as you wish and save it as .env
After that you can use docker-compose to setup the containers correctly:
docker-compose up build-editor
.. builds the editor for your desired OSdocker-compose up build-templates
.. builds the export templatesdocker-compose up export-game
.. exports your game for all available OS NOT YETdocker-compose up run-game
.. runs your game server scene
Dockerfile > build > Image > run > Container
docker ps
.. lists running containersdocker build --tag <image>
.. builds an image from dockerfiledocker run -d <image>
.. runs container in backgrounddocker run -it <image> bash
.. runs interactive containerdocker run -rm <image> bash
.. removes container on stopdocker run -name <container> <image>
.. starts a named containerdocker stop <container>
.. stops a named containerdocker start <container>
.. restarts a named containerdocker exec -it <container> bash
.. connect to a container