install.sh 1.8 KB
Newer Older
Torsten Grote's avatar
Torsten Grote committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/usr/bin/env bash
set -e
set -x

###############
# Debian Part #
###############

# do not install documentation to keep image small
echo "path-exclude=/usr/share/locale/*" >> /etc/dpkg/dpkg.cfg.d/01_nodoc
echo "path-exclude=/usr/share/man/*" >> /etc/dpkg/dpkg.cfg.d/01_nodoc
echo "path-exclude=/usr/share/doc/*" >> /etc/dpkg/dpkg.cfg.d/01_nodoc

# update package sources
apt-get update
apt-get -y upgrade

Torsten Grote's avatar
Torsten Grote committed
18 19 20
ls -la /usr/share/man/man1/
mkdir -p /usr/share/man/man1/

Torsten Grote's avatar
Torsten Grote committed
21 22 23 24 25
# install Debian packages
apt-get install -y --no-install-recommends \
	git \
	default-jdk-headless \
	unzip \
26
	curl \
Torsten Grote's avatar
Torsten Grote committed
27 28 29 30 31 32 33 34 35 36 37
	wget

# clean up for smaller image size
apt-get -y autoremove --purge
apt-get clean
rm -rf /var/lib/apt/lists/*

################
# Android Part #
################

Torsten Grote's avatar
Torsten Grote committed
38 39 40 41
update-alternatives --list java

# Install Android SDK Manager
wget --no-verbose -O tools.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
Torsten Grote's avatar
Torsten Grote committed
42 43 44 45 46 47 48
unzip tools.zip
rm tools.zip
mkdir ${ANDROID_HOME}
mv tools ${ANDROID_HOME}/

# Accept all those nasty EULAs
mkdir -p ${ANDROID_HOME}/licenses/
49
printf "\n8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > ${ANDROID_HOME}/licenses/android-sdk-license
Torsten Grote's avatar
Torsten Grote committed
50 51 52 53 54 55 56
printf "\n84831b9409646a918e30573bab4c9c91346d8abd" > ${ANDROID_HOME}/licenses/android-sdk-preview-license
printf "\n79120722343a6f314e0719f863036c702b0e6b2a\n84831b9409646a918e30573bab4c9c91346d8abd" > ${ANDROID_HOME}/licenses/android-sdk-preview-license-old

# Install platform-tools, build-tools and platform to prevent re-download each time
mkdir /root/.android
touch /root/.android/repositories.cfg
echo y | $ANDROID_HOME/tools/bin/sdkmanager "platform-tools"
57 58
echo y | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;29.0.2"
echo y | $ANDROID_HOME/tools/bin/sdkmanager "platforms;android-29"