-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
103 lines (91 loc) · 3.21 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
FROM ubuntu:20.04
## 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-11-jdk \
git \
wget \
build-essential \
zlib1g-dev \
libssl-dev \
libreadline-dev \
unzip
## Clean dependencies
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*
## Install rbenv
ENV RBENV_HOME "/root/.rbenv"
RUN git clone https://github.com/rbenv/rbenv.git $RBENV_HOME
ENV PATH "$PATH:$RBENV_HOME/bin"
ENV PATH "$PATH:$RBENV_HOME/shims"
# Install ruby-build (rbenv plugin)
RUN mkdir -p "$RBENV_HOME"/plugins
RUN git clone https://github.com/rbenv/ruby-build.git "$RBENV_HOME"/plugins/ruby-build
# Install default ruby env
RUN echo “install: --no-document” > ~/.gemrc
ENV RUBY_CONFIGURE_OPTS=--disable-install-doc
RUN rbenv install 2.7.0
RUN rbenv global 2.7.0
RUN gem install bundler:2.1.4
# 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
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 && \
export PATH=${gcloud_bin}:${PATH} && \
echo "Updated PATH: $PATH" \
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-29
ARG android_build_tools=29.0.3
ARG android_ndk=false
ARG ndk_version=21.0.6113669
ARG cmake=3.10.2.4988404
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