Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an image with software OpenGL enabled (sample working Dockerfile included) #102

Open
myaaaaaaaaa opened this issue Dec 6, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@myaaaaaaaaa
Copy link

myaaaaaaaaa commented Dec 6, 2022

The following Dockerfile builds on top of godot-ci:latest, bundles in the standard graphics-capable Godot build, installs the needed dependencies for running it on a server, and adds a godot_x11 wrapper script for running it with a dummy x11 server. I've confirmed that this is enough to run Godot with working software OpenGL (specifically, https://github.com/RodZill4/material-maker , which relies on GLSL, will correctly export textures)

Needed for adding CI tests to Material Maker, although there are almost certainly other projects that would find this useful.

FROM barichello/godot-ci

RUN apt-get update && apt-get install -y --no-install-recommends \
    libgl1 \
    libxcursor1 \
    libxi6 \
    libxinerama1 \
    libxrandr2 \
    xvfb \
    && rm -rf /var/lib/apt/lists/*

ARG GODOT_VERSION="3.5.1"
ARG RELEASE_NAME="stable"
ARG SUBDIR=""

RUN wget https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}${SUBDIR}/Godot_v${GODOT_VERSION}-${RELEASE_NAME}_x11.64.zip \
    && unzip Godot_v${GODOT_VERSION}-${RELEASE_NAME}_x11.64.zip \
    && rm Godot_v${GODOT_VERSION}-${RELEASE_NAME}_x11.64.zip \
    && mv Godot_v${GODOT_VERSION}-${RELEASE_NAME}_x11.64 /usr/local/bin/godot_x11_bin

RUN echo '#!/bin/sh \n xvfb-run godot_x11_bin "$@"' > /usr/local/bin/godot_x11 \
    && chmod +x /usr/local/bin/godot_x11

@Calinou Calinou added the enhancement New feature or request label Dec 6, 2022
@myaaaaaaaaa myaaaaaaaaa changed the title Add an image with software rendering enabled (sample working Dockerfile included) Add an image with software OpenGL enabled (sample working Dockerfile included) Dec 6, 2022
@realkotob
Copy link
Collaborator

@myaaaaaaaaa This looks good to me, would you like to open a PR?

@myaaaaaaaaa
Copy link
Author

@realkotob Thanks! This does add several gigabytes of dependencies to the image though, so it's probably not the best idea to just patch the main Dockerfile and call it a day. I think it's better to wait for someone more familiar with Docker and its best practices who will be able to add this to the release workflow properly as a separate image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants