|
1 |
| -# Godot engine build containers |
| 1 | +# Godot Engine Build Containers |
2 | 2 |
|
3 | 3 | This repository contains the Dockerfiles for the official Godot engine builds. These containers should help you build Godot for all platforms supported on any machine that can run Docker containers.
|
4 | 4 |
|
5 |
| -## Building |
6 | 5 |
|
7 |
| -There is a 'build.sh' script included to build the containers themselves. The in-container build scripts will follow shortly. |
| 6 | +## What is a Docker? |
| 7 | + |
| 8 | +They are like a chroot environment with its own filesystem, network stack, and process tree. They are similar to a virtual machine, but they use the same kernel as the host operating system. |
| 9 | + |
| 10 | +Basically a docker is a container wherein you can set up and run a complete environment without impacting your primary OS. After using these scripts, you will have set up several linux images, each designed to cross compile Godot for a particular platform with officially designated, compatible versions of compilers, sdks and libraries. |
| 11 | + |
| 12 | +[Read more about docker](https://docs.docker.com/engine/docker-overview/). |
| 13 | + |
| 14 | + |
| 15 | +## How to use |
| 16 | + |
| 17 | +1. Install [podman](https://podman.io/getting-started/) or [docker](https://docs.docker.com/install/). |
| 18 | + |
| 19 | + **Podman** has benefits over docker such as not requiring root or running a daemon. However if it uses the vfs system, it will waste a lot of space. You can reduce space usage by using overlayfs. Do these steps before creating any containers or images. |
| 20 | + |
| 21 | + 1. Install `fuse-overlayfs`. |
| 22 | + 1. Edit these lines under the named sections in `~/.config/containers/storage.conf`: |
| 23 | + ``` |
| 24 | + [storage] |
| 25 | + driver = "overlay" |
| 26 | + |
| 27 | + [storage.options] |
| 28 | + mount_program = "/usr/bin/fuse-overlayfs" |
| 29 | + ``` |
| 30 | + |
| 31 | +1. Clone the repository: |
| 32 | +`git clone https://github.com/godotengine/build-containers` |
| 33 | + |
| 34 | +1. Run `./build.sh <mono_version>`. As of November, 2019, the official binaries are being built with mono 5.18.1.3. |
| 35 | + |
| 36 | +1. Once build.sh completes, check your images. You can usally replace the command `podman` with `docker` if you installed the latter. |
| 37 | + ``` |
| 38 | + $ podman images |
| 39 | + REPOSITORY TAG IMAGE ID CREATED SIZE |
| 40 | + localhost/godot-android latest 8b894fa58db3 1 hour ago 12.8 GB |
| 41 | + localhost/godot-ubuntu-64 latest 45ecfc4e4fa0 9 hours ago 1.11 GB |
| 42 | + localhost/godot-ubuntu-32 latest fbc92a88f15a 10 hours ago 1.05 GB |
| 43 | + localhost/godot-windows latest 1f3e021fa80b 10 hours ago 3.38 GB |
| 44 | + localhost/godot-mono-glue latest c7702baefda2 10 hours ago 1.42 GB |
| 45 | + localhost/godot-mono 5.18.1.3 7f9ceb195878 10 hours ago 1.18 GB |
| 46 | + localhost/godot-export latest 3ce4d96d548f 11 hours ago 255 MB |
| 47 | + localhost/godot-fedora latest fb8358105a5e 11 hours ago 255 MB |
| 48 | + docker.io/library/fedora 30 89d6d6a7d521 2 weeks ago 255 MB |
| 49 | + docker.io/i386/ubuntu trusty 822956e6c5eb 6 months ago 187 MB |
| 50 | + docker.io/library/ubuntu trusty 2c5e00d77a67 6 months ago 197 MB |
| 51 | + ``` |
| 52 | + |
| 53 | +1. You can run a shell inside of a given docker image like this. Here `godot-windows` refers to the `localhost/godot-windows` image listed above. |
| 54 | + ``` |
| 55 | + $ podman run -it --rm godot-windows /usr/bin/bash |
| 56 | + |
| 57 | + [root@a117e628763d ~]# |
| 58 | + ``` |
| 59 | + |
| 60 | +1. You can mount your godot source tree into the docker, and then compile from there: |
| 61 | + ``` |
| 62 | + $ podman run -it --rm -v /home/user/godot:/root/godot godot-windows /usr/bin/bash |
| 63 | + |
| 64 | + [root@a117e628763d ~]# cd godot |
| 65 | + |
| 66 | + [root@a117e628763d godot]# scons -j8 p=windows bits=64 tools=yes target=release_debug module_mono_enabled=yes mono_static=yes mono_glue=yes copy_mono_root=yes mono_prefix=/root/dependencies/mono-64 |
| 67 | + ``` |
| 68 | + or you could run it all in one command: |
| 69 | + |
| 70 | + `podman run --rm -v /home/user/godot:/root/godot godot-windows scons -j8 -C godot p=windows bits=64 tools=yes target=release_debug module_mono_enabled=yes mono_static=yes mono_glue=yes copy_mono_root=yes mono_prefix=/root/dependencies/mono-64` |
| 71 | + |
| 72 | + |
| 73 | +1. You can simultaneously access the files in your godot directory from either inside the docker shell, or from your host OS. For instance, to grab the executables from the bin directory. |
| 74 | + |
| 75 | + |
| 76 | + |
8 | 77 |
|
0 commit comments