-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile
131 lines (116 loc) · 3.91 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
FROM ubuntu:20.04
# Required for Jenv
SHELL ["/bin/bash", "-c"]
## Set timezone to UTC by default
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
## Use unicode
RUN apt-get update && apt-get -y install locales && \
locale-gen en_US.UTF-8 || true
ENV LANG=en_US.UTF-8
## Install dependencies
RUN apt-get update && apt-get install --no-install-recommends -y \
openjdk-17-jdk \
openjdk-11-jdk \
openjdk-8-jdk \
git \
wget \
build-essential \
zlib1g-dev \
libssl-dev \
libreadline-dev \
unzip \
ssh \
# Fastlane plugins dependencies
# - fastlane-plugin-badge (curb)
libcurl4 libcurl4-openssl-dev \
# ruby-setup dependencies
libyaml-0-2 \
libgmp-dev \
file
## Clean dependencies
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*
## Install rbenv
ENV RBENV_ROOT "/root/.rbenv"
RUN git clone https://github.com/rbenv/rbenv.git $RBENV_ROOT
ENV PATH "$PATH:$RBENV_ROOT/bin"
ENV PATH "$PATH:$RBENV_ROOT/shims"
## Install jenv
ENV JENV_ROOT "$HOME/.jenv"
RUN git clone https://github.com/jenv/jenv.git $JENV_ROOT
ENV PATH "$PATH:$JENV_ROOT/bin"
RUN mkdir $JENV_ROOT/versions
ENV JDK_ROOT "/usr/lib/jvm/"
RUN jenv add ${JDK_ROOT}/java-8-openjdk-amd64
RUN jenv add ${JDK_ROOT}/java-11-openjdk-amd64
RUN jenv add ${JDK_ROOT}/java-17-openjdk-amd64
RUN echo 'export PATH="$JENV_ROOT/bin:$PATH"' >> ~/.bashrc
RUN echo 'eval "$(jenv init -)"' >> ~/.bashrc
# Install ruby-build (rbenv plugin)
RUN mkdir -p "$RBENV_ROOT"/plugins
RUN git clone https://github.com/rbenv/ruby-build.git "$RBENV_ROOT"/plugins/ruby-build
# Install ruby envs
RUN echo “install: --no-document” > ~/.gemrc
ENV RUBY_CONFIGURE_OPTS=--disable-install-doc
RUN rbenv install 3.1.1
RUN rbenv install 2.7.1
RUN rbenv install 2.6.6
# Setup default ruby env
RUN rbenv global 3.1.1
RUN gem install bundler:2.3.7
# Install Google Cloud CLI
ARG gcloud=false
ARG gcloud_url=https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz
ARG gcloud_home=/usr/local/gcloud
ARG gcloud_install_script=${gcloud_home}/google-cloud-sdk/install.sh
ARG gcloud_bin=${gcloud_home}/google-cloud-sdk/bin
ENV PATH=${gcloud_bin}:${PATH}
RUN if [ "$gcloud" = true ] ; \
then \
echo "Installing GCloud SDK"; \
apt-get update && apt-get install --no-install-recommends -y \
gcc \
python3 \
python3-dev \
python3-setuptools \
python3-pip && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
mkdir -p ${gcloud_home} && \
wget --quiet --output-document=/tmp/gcloud-sdk.tar.gz ${gcloud_url} && \
tar -C ${gcloud_home} -xvf /tmp/gcloud-sdk.tar.gz && \
${gcloud_install_script} && \
pip3 uninstall crcmod && \
pip3 install --no-cache-dir -U crcmod; \
else \
echo "Skipping GCloud SDK installation"; \
fi
## Install Android SDK
ARG sdk_version=commandlinetools-linux-6200805_latest.zip
ARG android_home=/opt/android/sdk
ARG android_api=android-34
ARG android_build_tools=34.0.0
ARG android_ndk=false
ARG ndk_version=26.1.10909125
ARG cmake=3.22.1
RUN mkdir -p ${android_home} && \
wget --quiet --output-document=/tmp/${sdk_version} https://dl.google.com/android/repository/${sdk_version} && \
unzip -q /tmp/${sdk_version} -d ${android_home} && \
rm /tmp/${sdk_version}
# Set environmental variables
ENV ANDROID_HOME ${android_home}
ENV PATH=${ANDROID_HOME}/emulator:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH}
RUN mkdir ~/.android && echo '### User Sources for Android SDK Manager' > ~/.android/repositories.cfg
RUN yes | sdkmanager --sdk_root=$ANDROID_HOME --licenses
RUN sdkmanager --sdk_root=$ANDROID_HOME --install \
"platform-tools" \
"build-tools;${android_build_tools}" \
"platforms;${android_api}"
RUN if [ "$android_ndk" = true ] ; \
then \
echo "Installing Android NDK ($ndk_version, cmake: $cmake)"; \
sdkmanager --sdk_root="$ANDROID_HOME" --install \
"ndk;${ndk_version}" \
"cmake;${cmake}" ; \
else \
echo "Skipping NDK installation"; \
fi