Skip to content

Instantly share code, notes, and snippets.

@talenguyen
Last active November 29, 2019 07:34
Show Gist options
  • Save talenguyen/faedcd1a9406cb951918fbd7cfcce70e to your computer and use it in GitHub Desktop.
Save talenguyen/faedcd1a9406cb951918fbd7cfcce70e to your computer and use it in GitHub Desktop.
Dockerfile to create Jenkins image. This image is includes essential tools that were be used internal in Android Development @tiki #docker, #android, #tiki
FROM jenkins/jenkins:lts
USER root # if we want to install via apt
RUN apt-get update
## Install essential libs
RUN apt-get install -y build-essential dh-autoreconf
## Install Node
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs
## Install Ruby
RUN apt-get install -y ruby ruby-dev
RUN gem install bundler
RUN gem install fastlane -NV
## Install imagemagick
RUN apt-get install -y imagemagick --fix-missing
## Install aws cli
RUN apt-get install -y awscli
## Cleanup
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
USER jenkins # drop back to the regular jenkins user - good practice
# Set Environment Variables
ENV CI=true
ENV AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>
ENV AWS_SECRET_ACCESS_KEY=<ENV AWS_SECRET_ACCESS_KEY>
#!/usr/bin/env bash
set -xeuo pipefail
docker run \
-u root \
-it --rm \
-e DANGER_GITHUB_API_TOKEN="<token>" \
-v "${PWD}":"/src/android" \
-v "${HOME}/gradle_cache":"/src/android/cache" \
-w "/src/android" \
talenguyen/android:1.0.1 \
sh -c "/src/android/docker.sh /src/android/cache"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment