-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
70 lines (59 loc) · 2.62 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM ubuntu:cosmic
LABEL author="[email protected]"
ENV GODOT_VERSION "3.1.2"
ENV GODOT_BUILD="Godot_v${GODOT_VERSION}-stable_linux_headless.64"
ENV SDK_TOOLS_VERSION "4333796"
# install basic packages
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
ca-certificates \
git \
python \
python-openssl \
unzip \
wget \
zip \
&& rm -rf /var/lib/apt/lists/*
# add openjdk repo
RUN add-apt-repository ppa:openjdk-r/ppa
# install openjdk
RUN apt-get update \
&& apt-get install openjdk-8-jdk -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# download and unzip android-sdk-linux
RUN export ANDROID_HOME=/opt/android-sdk-linux \
&& mkdir -p $ANDROID_HOME \
&& cd $ANDROID_HOME \
&& wget https://dl.google.com/android/repository/sdk-tools-linux-${SDK_TOOLS_VERSION}.zip \
&& unzip sdk-tools-linux-${SDK_TOOLS_VERSION}.zip \
&& rm -f sdk-tools-linux-${SDK_TOOLS_VERSION}.zip
# install android sdk platform tools
RUN cd /opt/android-sdk-linux/tools/bin \
&& yes | ./sdkmanager platform-tools \
&& ./sdkmanager --update
# download and unzip godot templates
RUN wget https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/Godot_v${GODOT_VERSION}-stable_export_templates.tpz \
&& mkdir ~/.cache \
&& mkdir -p ~/.config/godot \
&& mkdir -p ~/.local/share/godot/templates/${GODOT_VERSION}.stable \
&& unzip Godot_v${GODOT_VERSION}-stable_export_templates.tpz \
&& mv templates/* ~/.local/share/godot/templates/${GODOT_VERSION}.stable \
&& rm -f Godot_v${GODOT_VERSION}-stable_export_templates.tpz
# download unzip godot
RUN wget https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/${GODOT_BUILD}.zip \
&& unzip ${GODOT_BUILD}.zip \
&& mv ${GODOT_BUILD} /usr/local/bin/godot \
&& rm -f ${GODOT_BUILD}.zip
# copy edit-tres
COPY ./edit-tres.sh /edit-tres.sh
# make edit-tres.sh executable
RUN chmod +x /edit-tres.sh
# create editor_settings
RUN export path_to_editor_settings=root/.config/godot/editor_settings-3.tres \
&& mkdir -p $(dirname "$path_to_editor_settings") \
&& touch $path_to_editor_settings \
&& echo "[gd_resource type=\"EditorSettings\" format=2]" >> $path_to_editor_settings \
&& echo "[resource]" >> $path_to_editor_settings \
&& ./edit-tres.sh $path_to_editor_settings export/android/adb /opt/android-sdk-linux/platform-tools/adb \
&& ./edit-tres.sh $path_to_editor_settings export/android/jarsigner /usr/lib/jvm/java-8-openjdk-amd64/bin/jarsigner \
&& ./edit-tres.sh $path_to_editor_settings export/android/debug_keystore /usr/android-keys/debug.keystore