Skip to content

Instantly share code, notes, and snippets.

@eaglesakura
Created Jun 19, 2018
Embed
What would you like to do?
###########################################
## ver 2.0 : Base image changed to ubuntu-18.04
###########################################
FROM ubuntu:18.04
MAINTAINER @eaglesakura
###########################################
## Build Options ##
###########################################
ARG ANDROID_SDK_DOWNLOAD_URL=https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
ARG ANDORID_BUNDLETOOL_DOWNLOAD_URL=https://github.com/google/bundletool/releases/download/0.3.3/bundletool-all-0.3.3.jar
ARG ANDROID_BUILD_TOOLS_VERSION=27.0.3
ARG ANDROID_TARGET_SDK_VERSION=27
ARG ANDROID_TOOLS_CHANNEL=3
ARG XAMARIN_ANDROID_DOWNLOAD_URL=https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-linux/993/Azure/processDownloadRequest/xamarin-android/xamarin.android-oss_8.3.99.189_amd64.deb
ARG GCLOUD_DOWNLOAD_URL=https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-192.0.0-linux-x86_64.tar.gz
ARG NODEJS_VERSION=8.11.1
ARG FIREBASE_TOOLS_VERSION=3.18.4
ARG IMAGEMAGICK_VERSION=7.0.5-10
ARG IMAGEMAGICK_DOWNLOAD_URL=https://codeload.github.com/ImageMagick/ImageMagick/zip/7.0.5-10
ARG GOLANG_DOWNLOAD_URL=https://storage.googleapis.com/golang/go1.9.4.linux-amd64.tar.gz
###########################################
## commit files ##
###########################################
ADD files.tar.gz /
RUN chmod -R +x /usr/local/bin \
&& chmod -R +x $HOME/tools \
&& chmod -R 0600 $HOME/.ssh \
&& echo 'source $HOME/ubuntu.bashrc' >> $HOME/.bashrc
###########################################
## Environment ##
###########################################
ENV LANG="ja_JP.UTF-8" \
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
RUN dpkg --add-architecture i386 \
&& apt-get update \
&& apt install --fix-missing -y \
language-pack-ja-base language-pack-ja \
libc6:i386 libstdc++6:i386 \
vim curl wget zip unzip git-core git-flow maven jq tree xmlstarlet apt-transport-https iputils-ping net-tools whois \
&& sh -c "$(curl -fsSL https://raw.githubusercontent.com/eaglesakura/git-flow-hook/master/installer/install-commands.sh)" \
&& update-locale LANG=ja_JP.UTF-8
###########################################
## Programming Languages ##
###########################################
# java8
ENV _JAVA_OPTIONS="-Dfile.encoding=UTF-8" \
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/"
RUN apt install -y openjdk-8-jdk
# golang
ENV GOROOT="/root/tools/go" \
GOPATH="/root/tools/gopath" \
GOBIN="/root/tools/gopath/bin"
ENV PATH="/root/tools/go/bin:/root/tools/gopath/bin:$PATH"
RUN mkdir $HOME/tools/gopath \
&& mkdir $HOME/tools/gopath/bin \
&& wget $GOLANG_DOWNLOAD_URL -O $HOME/golang.temp.tar.gz \
&& tar xovfz "$HOME/golang.temp.tar.gz" -C "$HOME/tools/" > /dev/null \
&& go get -f -u github.com/eaglesakura/prjdep \
&& go get -f -u github.com/eaglesakura/xpipeline \
&& rm $HOME/golang.temp.tar.gz \
&& rm -rf /root/tools/gopath/src
# install node.js
RUN apt install --fix-missing -y nodejs npm \
&& npm cache clean \
&& npm install n -g \
&& n $NODEJS_VERSION \
&& ln -sf /usr/local/bin/node /usr/bin/node \
&& apt-get purge -y nodejs npm
RUN npm install -g standard@10.0.2 --save-dev \
&& npm install -g mocha@3.4.2 \
&& npm install -g firebase-tools@$FIREBASE_TOOLS_VERSION
# mono/C-Sharp
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb http://download.mono-project.com/repo/ubuntu bionic main" | tee /etc/apt/sources.list.d/mono-official.list \
&& apt update \
&& apt install -y mono-complete mono-devel nuget libzip-dev
###########################################
## Android Dev ##
###########################################
ENV ANDROID_HOME=/root/tools/android/sdk \
ANDROID_NDK_HOME="/root/tools/android/sdk/ndk-bundle"
ENV PATH=$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/ndk-bundle:$PATH
RUN mkdir $HOME/tools/android \
&& mkdir ${ANDROID_HOME} \
&& mkdir ${ANDROID_HOME}/licenses \
&& mkdir $HOME/.android/ \
&& touch $HOME/.android/repositories.cfg \
&& wget ${ANDROID_SDK_DOWNLOAD_URL} -O $HOME/android-sdk.zip \
&& unzip -d $HOME/tools/android/sdk $HOME/android-sdk.zip > /dev/null \
&& rm $HOME/android-sdk.zip \
&& yes | sdkmanager "platform-tools" \
&& yes | sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" \
&& yes | sdkmanager "platforms;android-${ANDROID_TARGET_SDK_VERSION}" \
&& yes | sdkmanager "extras;android;m2repository" \
&& yes | sdkmanager "extras;google;google_play_services" \
&& yes | sdkmanager "extras;google;m2repository" \
&& yes | sdkmanager --channel=$ANDROID_TOOLS_CHANNEL --update \
&& wget ${ANDORID_BUNDLETOOL_DOWNLOAD_URL} -O $HOME/tools/bundletool.jar \
&& echo 'alias bundletool="java -jar $HOME/tools/bundletool.jar"' >> $HOME/.bashrc
###########################################
## gcloud/AppEngine ##
###########################################
ENV PATH="/root/tools/google-cloud-sdk/bin:/root/tools/google-cloud-sdk/platform/google_appengine:/root/tools/google-cloud-sdk/platform/google_appengine/goroot-1.9/bin:/root/tools/google-cloud-sdk/platform/google_appengine/dev_appserver.py:/root/tools/google-cloud-sdk/platform/google_appengine/endpointscfg.py:$PATH"
RUN cd $HOME/tools \
&& wget -O gcloud.tar.gz $GCLOUD_DOWNLOAD_URL \
&& tar xovfz gcloud.tar.gz -C $HOME/tools \
&& rm gcloud.tar.gz \
&& yes | ./google-cloud-sdk/install.sh \
&& wget https://bootstrap.pypa.io/get-pip.py -O $HOME/get-pip.py \
&& python $HOME/get-pip.py \
&& rm $HOME/get-pip.py \
&& gcloud components install \
app-engine-go app-engine-java \
&& for py in `find /root/tools/google-cloud-sdk/platform/google_appengine -name "*.py"`; do chmod +x $py; done
###########################################
## Xamarin.Android ##
###########################################
RUN mkdir $HOME/tools/xamarin \
&& wget -O xamarin.deb $XAMARIN_ANDROID_DOWNLOAD_URL \
&& dpkg -i xamarin.deb \
&& rm xamarin.deb
###########################################
## ImageMagick with WebP ##
###########################################
RUN apt install -y \
libwebp-dev libx11-dev libxext-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev libxml2-dev libgif-dev libbz2-dev \
build-essential checkinstall \
&& cd $HOME/tools/ \
&& wget -O imagemagick.zip $IMAGEMAGICK_DOWNLOAD_URL \
&& unzip imagemagick.zip > /dev/null \
&& rm imagemagick.zip \
&& cd $HOME/tools/ImageMagick-$IMAGEMAGICK_VERSION \
&& ./configure --with-webp=yes --with-png=yes --with-jpeg=yes --with-zlib=yes --with-bzlib=yes \
&& make \
&& make install \
&& cd .. \
&& rm -rf ImageMagick-$IMAGEMAGICK_VERSION
###########################################
## private settings ##
###########################################
RUN git config --global user.email your-email@example.com \
&& git config --global user.name eaglesakura \
&& git config --global core.filemode false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment