-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
42 lines (32 loc) · 1.71 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#
# Set EXPORT_NAME to your template's name and OUTPUT_FILENAME accordingly.
# Add two volumes, one from your repository to /build/src and another to
# /build/output where the product will be stored.
#
# E.g. inside your game's main folder (find the product in /tmp/output):
#
# docker run \
# -e EXPORT_NAME="HTML5" \
# -e OUTPUT_FILENAME="index.html" \
# -v $(pwd):/build/src -v /tmp/output:/build/output gamedrivendesign/godot-export
FROM alpine:edge
ARG GODOT_VERSION
WORKDIR /build
RUN apk --no-cache add ca-certificates wget
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk \
&& apk add glibc-2.29-r0.apk
RUN wget -q --waitretry=1 --retry-connrefused -T 10 https://downloads.tuxfamily.org/godotengine/$GODOT_VERSION/Godot_v$GODOT_VERSION-stable_linux_headless.64.zip -O /tmp/godot.zip \
&& unzip -q -d /tmp /tmp/godot.zip \
&& mv /tmp/Godot* /build/godot
RUN wget -q --waitretry=1 --retry-connrefused -T 10 https://downloads.tuxfamily.org/godotengine/$GODOT_VERSION/Godot_v$GODOT_VERSION-stable_export_templates.tpz -O /tmp/export-templates.tpz \
&& mkdir -p /tmp/data/godot/templates \
&& unzip -q -d /tmp/data/godot/templates /tmp/export-templates.tpz \
&& mv /tmp/data/godot/templates/templates /tmp/data/godot/templates/$GODOT_VERSION.stable
ENV XDG_CACHE_HOME /tmp/cache
ENV XDG_DATA_HOME /tmp/data
ENV XDG_CONFIG_HOME /tmp/config
RUN mkdir -p /tmp/cache && mkdir -p /tmp/data && mkdir -p /tmp/config
ENV EXPORT_NAME HTML5
ENV OUTPUT_FILENAME index.html
CMD ["sh", "-c", "/build/godot --export \"${EXPORT_NAME}\" --path /build/src \"/build/output/${OUTPUT_FILENAME}\""]