|
1 | 1 | # Godot engine build containers |
2 | 2 |
|
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. |
| 3 | +This repository contains the Dockerfiles for the official Godot engine builds. |
| 4 | +These containers should help you build Godot for all platforms supported on |
| 5 | +any machine that can run Docker containers. |
4 | 6 |
|
5 | | -## Building |
| 7 | +The in-container build scripts are in a separate repository: |
| 8 | +https://github.com/godotengine/godot-build-scripts |
6 | 9 |
|
7 | | -There is a 'build.sh' script included to build the containers themselves. |
8 | 10 |
|
9 | | -The in-container build scripts are in a separate repository: https://github.com/godotengine/godot-build-scripts |
| 11 | +## Introduction |
| 12 | + |
| 13 | +These scripts build a number of containers which are then used to build final |
| 14 | +Godot tools, templates and server packages for several platforms. |
| 15 | + |
| 16 | +Once these containers are built, they can be used to compile different Godot |
| 17 | +versions without the need of recreating them. |
| 18 | + |
| 19 | +The `upload.sh` file is meant to be used by Godot Release Team and is not |
| 20 | +documented here. |
| 21 | + |
| 22 | + |
| 23 | +## Requirements |
| 24 | + |
| 25 | +These containers have been tested under Fedora 33 and Ubuntu 18.04 (others may work too). |
| 26 | + |
| 27 | +The tool used to build and manage the containers is `podman`. |
| 28 | + |
| 29 | +See the Host OS section below for further information on how to setup your host OS before start. |
| 30 | + |
| 31 | + |
| 32 | +## Usage |
| 33 | + |
| 34 | +The 'build.sh' script included is used to build the containers themselves. |
| 35 | + |
| 36 | +Run the command using: |
| 37 | + |
| 38 | + ./build.sh 3.2 mono-6.12.0.114 |
| 39 | + |
| 40 | +Note that this will also download that Mono branch (2020-02) from Mono repository. |
| 41 | +That branch corresponds to the given Mono version (6.12.0.114) as per |
| 42 | +https://www.mono-project.com/docs/about-mono/versioning/#mono-source-versioning . |
| 43 | + |
| 44 | +More details can be found in the Godot https://github.com/godotengine/godot-mono-builds |
| 45 | +repository (but you don't need this repository, as in this case Mono is built |
| 46 | +inside the containers) |
| 47 | + |
| 48 | +The above will generate images using the tag '3.2-mono-6.12.0.114'. This is convenient |
| 49 | +since as of today, this branch can be used to compile every 3.2.x version or |
| 50 | +your custom modifications. |
| 51 | + |
| 52 | +### Selecting which images to build |
| 53 | + |
| 54 | +If you don't need to build all versions or you want to try with a single target OS first, |
| 55 | +you can comment out the corresponding lines from the script: |
| 56 | + |
| 57 | + $podman_build_mono -t godot-windows:${img_version} -f Dockerfile.windows --ulimit nofile=65536 . 2>&1 | tee logs/windows.log |
| 58 | + $podman_build_mono -t godot-ubuntu-64:${img_version} -f Dockerfile.ubuntu-64 . 2>&1 | tee logs/ubuntu-64.log |
| 59 | + $podman_build_mono -t godot-ubuntu-32:${img_version} -f Dockerfile.ubuntu-32 . 2>&1 | tee logs/ubuntu-32.log |
| 60 | + $podman_build_mono -t godot-javascript:${img_version} -f Dockerfile.javascript . 2>&1 | tee logs/javascript.log |
| 61 | + $podman_build_mono -t godot-android:${img_version} -f Dockerfile.android . 2>&1 | tee logs/android.log |
| 62 | + ... |
| 63 | + |
| 64 | +## Host OS preparation |
| 65 | + |
| 66 | +### Podman Fedora image |
| 67 | + |
| 68 | +To be extra-sure that you are building with the same base container image as the official |
| 69 | +builds, you can use: |
| 70 | + |
| 71 | + podman pull registry.fedoraproject.org/fedora@sha256:acc80ce6652d35f55ad220aa1cfa3787cbaf19b0016b202f1ab29dc5060f5392 |
| 72 | + podman image tag registry.fedoraproject.org/fedora@27a979020952 fedora:32 |
| 73 | + |
| 74 | +### Fedora 33 Host |
| 75 | + |
| 76 | +Fedora 33 default configuration is able to build the containers. Ensure the tools |
| 77 | +are installed: |
| 78 | + |
| 79 | + sudo dnf -y install podman |
| 80 | + |
| 81 | +### Ubuntu 18.04 Host |
| 82 | + |
| 83 | +Install `podman` (as per https://podman.io/getting-started/installation). On |
| 84 | +Ubuntu 18.04, podman 2.2.1 was used successfully: |
| 85 | + |
| 86 | + . /etc/os-release |
| 87 | + echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list |
| 88 | + curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add - |
| 89 | + sudo apt-get update |
| 90 | + sudo apt-get -y upgrade |
| 91 | + sudo apt-get -y install podman |
| 92 | + # (Ubuntu 18.04) Restart dbus for rootless podman |
| 93 | + systemctl --user restart dbus |
| 94 | + |
| 95 | +Modify your system default ulimit to support more open file handlers. |
| 96 | +Add this at the end of your /etc/sysctl.conf file: |
| 97 | + |
| 98 | + fs.file-max = 65536 |
| 99 | + |
| 100 | +Then reboot or run: |
| 101 | + |
| 102 | + sudo sysctl -p |
| 103 | + |
| 104 | +Install Python3 dataclasses: |
| 105 | + |
| 106 | + pip3 install dataclasses |
| 107 | + |
| 108 | +Install wine64, binfmt_misc, and configure it: |
| 109 | + |
| 110 | + sudo apt install wine64 wine64-preloader binfmt-support |
| 111 | + |
| 112 | + sudo bash -c "echo -1 > /proc/sys/fs/binfmt_misc/wine" # It's ok this command fails, eg. if you don't have wine binfmt |
| 113 | + sudo bash -c 'echo ":windows:M::MZ::/usr/bin/wine:" > /proc/sys/fs/binfmt_misc/register' |
| 114 | + sudo bash -c 'echo ":windowsPE:M::PE::/usr/bin/wine:" > /proc/sys/fs/binfmt_misc/register' |
| 115 | + |
| 116 | +This `binfmt` configuration **is not persistent**, you need to do it after a reboot in order to build the containers. |
| 117 | + |
| 118 | +(Note that this may break previous .exe binfmt support through `run-detectors`). |
| 119 | + |
| 120 | + |
| 121 | +## Appendix: Image sizes |
| 122 | + |
| 123 | +These are the expected container image sizes, so you can plan your disk usage in advance: |
| 124 | + |
| 125 | + REPOSITORY TAG SIZE |
| 126 | + localhost/godot-fedora 3.2-mono-6.12.0.114 692 MB |
| 127 | + localhost/godot-export 3.2-mono-6.12.0.114 1.09 GB |
| 128 | + localhost/godot-mono 3.2-mono-6.12.0.114 1.51 GB |
| 129 | + localhost/godot-mono-glue 3.2-mono-6.12.0.114 1.73 GB |
| 130 | + localhost/godot-msvc 3.2-mono-6.12.0.114 11.5 GB |
| 131 | + localhost/godot-windows 3.2-mono-6.12.0.114 4.42 GB |
| 132 | + localhost/godot-ubuntu-64 3.2-mono-6.12.0.114 1.08 GB |
| 133 | + localhost/godot-ubuntu-32 3.2-mono-6.12.0.114 1 GB |
| 134 | + localhost/godot-javascript 3.2-mono-6.12.0.114 4.72 GB |
| 135 | + localhost/godot-android 3.2-mono-6.12.0.114 19.7 GB |
| 136 | + localhost/godot-osx 3.2-mono-6.12.0.114 2.84 GB |
| 137 | + localhost/godot-ios 3.2-mono-6.12.0.114 4.53 GB |
| 138 | + |
| 139 | +In addition to this, generating containers will also require some host disk space (around 4.5GB) |
| 140 | +for the downloaded Mono sources and dependencies. |
10 | 141 |
|
0 commit comments