├── 32
├── Dockerfile
└── tools
│ ├── adb-all
│ └── license_accepter
├── 33
├── Dockerfile
└── tools
│ ├── adb-all
│ └── license_accepter
├── 34
├── Dockerfile
└── tools
│ ├── adb-all
│ └── license_accepter
├── .github
└── workflows
│ └── release-image.yml
├── 32-emulator
├── Dockerfile
├── tools-emulator
│ ├── android-start-emulator
│ └── android-wait-for-emulator
└── tools
│ ├── adb-all
│ └── license_accepter
├── 32-jdk17
├── Dockerfile
└── tools
│ ├── adb-all
│ └── license_accepter
├── 32-ndk
├── Dockerfile
└── tools
│ ├── adb-all
│ └── license_accepter
├── 32-stf-client
├── Dockerfile
└── tools
│ ├── adb-all
│ └── license_accepter
├── 33-emulator
├── Dockerfile
├── tools-emulator
│ ├── android-start-emulator
│ └── android-wait-for-emulator
└── tools
│ ├── adb-all
│ └── license_accepter
├── 33-jdk17
├── Dockerfile
└── tools
│ ├── adb-all
│ └── license_accepter
├── 33-ndk
├── Dockerfile
└── tools
│ ├── adb-all
│ └── license_accepter
├── 33-stf-client
├── Dockerfile
└── tools
│ ├── adb-all
│ └── license_accepter
├── 34-emulator
├── Dockerfile
├── tools-emulator
│ ├── android-start-emulator
│ └── android-wait-for-emulator
└── tools
│ ├── adb-all
│ └── license_accepter
├── 34-jdk11
├── Dockerfile
└── tools
│ ├── adb-all
│ └── license_accepter
├── 34-ndk
├── Dockerfile
└── tools
│ ├── adb-all
│ └── license_accepter
├── 34-stf-client
├── Dockerfile
└── tools
│ ├── adb-all
│ └── license_accepter
├── Dockerfile.template
├── LICENSE.txt
├── README.md
├── tools-emulator
├── android-start-emulator
└── android-wait-for-emulator
├── tools
├── adb-all
└── license_accepter
└── update.sh
/.github/workflows/release-image.yml:
--------------------------------------------------------------------------------
1 | name: Create and publish a Docker image
2 |
3 | # Cache setup: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md
4 | # Multi push: https://github.com/docker/build-push-action/blob/master/docs/advanced/push-multi-registries.md
5 |
6 | on:
7 | push:
8 | branches: ["*"]
9 | pull_request:
10 |
11 | jobs:
12 | checks-update:
13 | runs-on: ubuntu-latest
14 | permissions:
15 | contents: read
16 | steps:
17 | - name: Checkout repository
18 | uses: actions/checkout@v4
19 |
20 | - name: Check update has been run
21 | run: |
22 | ./update.sh
23 | git diff --quiet
24 |
25 | checks-hadolint:
26 | runs-on: ubuntu-latest
27 | permissions:
28 | contents: read
29 | container: hadolint/hadolint:latest-debian
30 | steps:
31 | - name: Checkout repository
32 | uses: actions/checkout@v4
33 |
34 | - name: Check hadolint
35 | run: |
36 | hadolint */Dockerfile
37 |
38 | checks-shfmt:
39 | runs-on: ubuntu-latest
40 | permissions:
41 | contents: read
42 | container: mvdan/shfmt:latest-alpine
43 | steps:
44 | - name: Checkout repository
45 | uses: actions/checkout@v4
46 |
47 | - name: Check shfmt
48 | run: |
49 | shfmt -i 2 -ci -d update.sh
50 | shfmt -i 2 -ci -d tools/adb-all
51 | shfmt -i 2 -ci -d tools/license_accepter
52 | shfmt -i 2 -ci -d tools-emulator/android-start-emulator
53 | shfmt -i 2 -ci -d tools-emulator/android-wait-for-emulator
54 |
55 | checks-shellcheck:
56 | runs-on: ubuntu-latest
57 | permissions:
58 | contents: read
59 | container: koalaman/shellcheck-alpine:latest
60 | steps:
61 | - name: Checkout repository
62 | uses: actions/checkout@v4
63 |
64 | - name: Check shellcheck
65 | run: |
66 | shellcheck update.sh
67 | shellcheck tools/adb-all
68 | shellcheck tools/license_accepter
69 | shellcheck tools-emulator/android-start-emulator
70 | shellcheck tools-emulator/android-wait-for-emulator
71 |
72 | build-and-push-image:
73 | runs-on: ubuntu-latest
74 | permissions:
75 | contents: read
76 | packages: write
77 | strategy:
78 | matrix:
79 | version: ["32", "33", "34"]
80 | variant: ["", "-emulator", "-ndk", "-stf-client", "-jdk17", "-jdk11"]
81 | needs: [checks-hadolint, checks-shfmt, checks-shellcheck, checks-update]
82 | steps:
83 | - name: Checkout repository
84 | uses: actions/checkout@v4
85 |
86 | - name: Check Exists
87 | id: check-dir
88 | run: |
89 | if [ ! -d ${{ matrix.version }}${{ matrix.variant }} ]; then
90 | echo "Directory ${{ matrix.version }}${{ matrix.variant }} does not exist"
91 | echo "skipdir=true" >> $GITHUB_OUTPUT
92 | fi
93 |
94 | - name: Set up Docker Buildx
95 | if: steps.check-dir.outputs.skipdir != 'true'
96 | uses: docker/setup-buildx-action@v3
97 |
98 | - name: Login to Docker Hub
99 | if: steps.check-dir.outputs.skipdir != 'true' && github.ref == 'refs/heads/main'
100 | uses: docker/login-action@v3
101 | with:
102 | username: ${{ secrets.DOCKER_HUB_USERNAME }}
103 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
104 |
105 | - name: Login to GAR
106 | if: steps.check-dir.outputs.skipdir != 'true' && github.ref == 'refs/heads/main'
107 | uses: docker/login-action@v3
108 | with:
109 | registry: europe-west1-docker.pkg.dev
110 | username: _json_key
111 | password: ${{ secrets.GCR_JSON_KEY }}
112 |
113 | - name: Extract metadata (tags, labels) for Docker
114 | id: meta
115 | if: steps.check-dir.outputs.skipdir != 'true'
116 | uses: docker/metadata-action@v5
117 | with:
118 | images: |
119 | ekreative/android
120 | europe-west1-docker.pkg.dev/ekreative-internal/ci/android
121 | tags: |
122 | type=raw,value=${{ matrix.version }}${{ matrix.variant }}
123 | flavor: |
124 | latest=${{ toJSON(matrix.version == '31' && matrix.variant == '' && github.ref == 'refs/heads/main') }}
125 |
126 | - name: Cache Mode
127 | id: cache-mode
128 | if: steps.check-dir.outputs.skipdir != 'true'
129 | run: |
130 | if [ "$VARIANT" == '-emulator' ]; then
131 | echo "mode=min" >>$GITHUB_OUTPUT
132 | else
133 | echo "mode=max" >>$GITHUB_OUTPUT
134 | fi
135 | env:
136 | VARIANT: ${{ matrix.variant }}
137 |
138 | - name: Build and push Docker image
139 | if: steps.check-dir.outputs.skipdir != 'true'
140 | uses: docker/build-push-action@v5
141 | with:
142 | context: ${{ matrix.version }}${{ matrix.variant }}
143 | push: ${{ github.ref == 'refs/heads/main' }}
144 | tags: ${{ steps.meta.outputs.tags }}
145 | labels: ${{ steps.meta.outputs.labels }}
146 | cache-from: type=gha
147 | cache-to: type=gha,mode=${{ steps.cache-mode.outputs.mode }}
148 |
--------------------------------------------------------------------------------
/32-emulator/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-11-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=32
71 | ENV ANDROID_BUILD_TOOLS_VERSION=32.0.0
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES="build-tools;32.0.0"
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 |
79 | ####
80 | # hadolint ignore=DL3008
81 | RUN apt-get update \
82 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
83 | file \
84 | qt5-default \
85 | libpulse0 \
86 | && rm -rf /var/lib/apt/lists/*
87 |
88 | ENV ANDROID_EMULATOR_PACKAGE="system-images;android-$ANDROID_PLATFORM_VERSION;google_apis_playstore;x86_64"
89 | RUN sdkmanager --verbose "emulator" $ANDROID_EMULATOR_PACKAGE
90 |
91 | # Fix for emulator detect 64bit
92 | ENV SHELL=/bin/bash
93 | # https://www.bram.us/2017/05/12/launching-the-android-emulator-from-the-command-line/
94 | ENV PATH=$ANDROID_SDK_ROOT/emulator:$PATH
95 |
96 | COPY tools-emulator/android-start-emulator /opt/tools/
97 | COPY tools-emulator/android-wait-for-emulator /opt/tools/
98 | RUN adb keygen ~/.android/adbkey
99 | ####
100 |
101 |
102 | ####
103 | # hadolint ignore=DL3008,SC1091
104 | RUN apt-get update \
105 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
106 | && rm -rf /var/lib/apt/lists/* \
107 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
108 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
109 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
110 | && source /usr/local/rvm/scripts/rvm \
111 | && gem install bundler -v '~> 1.0' --force --no-document --default
112 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
113 | ####
114 |
--------------------------------------------------------------------------------
/32-emulator/tools-emulator/android-start-emulator:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | # shellcheck disable=SC2086
5 | avdmanager create avd --package "$ANDROID_EMULATOR_PACKAGE" --name "${AVD_NAME:-test}" --abi "google_apis_playstore/x86_64" --device "${AVD_DEVICE:-pixel}" --force ${AVD_ARGS:-}
6 | # shellcheck disable=SC2086
7 | emulator -avd "${AVD_NAME:-test}" -no-audio -no-boot-anim -no-window -accel on -gpu off ${EMULATOR_ARGS:-} &
8 | android-wait-for-emulator
9 | adb shell input keyevent 82
10 |
--------------------------------------------------------------------------------
/32-emulator/tools-emulator/android-wait-for-emulator:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 | # Originally written by Ralf Kistner , but placed in the public domain
4 |
5 | sleep_time=5
6 | timeout_in_sec=60
7 |
8 | fail_counter=0
9 | until [[ "$(adb -e shell getprop init.svc.bootanim)" =~ "stopped" ]]; do
10 | ((fail_counter += sleep_time))
11 | echo "Waiting for emulator to start (bootanim)"
12 | if [[ $fail_counter -gt timeout_in_sec ]]; then
13 | echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
14 | exit 1
15 | fi
16 | sleep $sleep_time
17 | done
18 |
19 | fail_counter=0
20 | until [[ "$(adb -e shell getprop sys.boot_completed)" == "1" ]]; do
21 | ((fail_counter += sleep_time))
22 | echo "Waiting for emulator to start (boot_completed)"
23 | if [[ $fail_counter -gt timeout_in_sec ]]; then
24 | echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
25 | exit 1
26 | fi
27 | sleep $sleep_time
28 | done
29 |
30 | echo "Emulator is ready"
31 |
--------------------------------------------------------------------------------
/32-emulator/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/32-emulator/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/32-jdk17/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-17-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=32
71 | ENV ANDROID_BUILD_TOOLS_VERSION=32.0.0
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES="build-tools;32.0.0"
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 |
79 |
80 |
81 | ####
82 | # hadolint ignore=DL3008,SC1091
83 | RUN apt-get update \
84 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
85 | && rm -rf /var/lib/apt/lists/* \
86 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
87 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
88 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
89 | && source /usr/local/rvm/scripts/rvm \
90 | && gem install bundler -v '~> 1.0' --force --no-document --default
91 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
92 | ####
93 |
--------------------------------------------------------------------------------
/32-jdk17/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/32-jdk17/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/32-ndk/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-11-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=32
71 | ENV ANDROID_BUILD_TOOLS_VERSION=32.0.0
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES="build-tools;32.0.0"
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 |
79 |
80 | ####
81 | ENV ANDROID_NDK_PACKAGES="ndk-bundle cmake;3.10.2.4988404 cmake;3.6.4111459 cmake;3.18.1"
82 | ENV ANDROID_NDK_ROOT=$ANDROID_HOME/ndk-bundle
83 | ENV ANDROID_NDK_HOME=$ANDROID_NDK_ROOT
84 | RUN sdkmanager --verbose $ANDROID_NDK_PACKAGES
85 | ####
86 |
87 | ####
88 | # hadolint ignore=DL3008,SC1091
89 | RUN apt-get update \
90 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
91 | && rm -rf /var/lib/apt/lists/* \
92 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
93 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
94 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
95 | && source /usr/local/rvm/scripts/rvm \
96 | && gem install bundler -v '~> 1.0' --force --no-document --default
97 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
98 | ####
99 |
--------------------------------------------------------------------------------
/32-ndk/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/32-ndk/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/32-stf-client/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-11-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=32
71 | ENV ANDROID_BUILD_TOOLS_VERSION=32.0.0
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES="build-tools;32.0.0"
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 | ####
79 | # hadolint ignore=DL3008,DL3028,SC2086
80 | RUN apt-get update \
81 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
82 | ruby \
83 | && savedAptMark="$(apt-mark showmanual)" \
84 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
85 | # stf-client
86 | build-essential \
87 | gem \
88 | # Without rake fails to install stf-client
89 | && gem install rake stf-client --no-doc \
90 | && apt-mark auto '.*' > /dev/null \
91 | && apt-mark manual $savedAptMark > /dev/null \
92 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
93 | && rm -rf /var/lib/apt/lists/* \
94 |
95 | RUN adb keygen ~/.android/adbkey
96 | ####
97 |
98 |
99 |
100 | ####
101 | # hadolint ignore=DL3008,SC1091
102 | RUN apt-get update \
103 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
104 | && rm -rf /var/lib/apt/lists/* \
105 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
106 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
107 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
108 | && source /usr/local/rvm/scripts/rvm \
109 | && gem install bundler -v '~> 1.0' --force --no-document --default
110 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
111 | ####
112 |
--------------------------------------------------------------------------------
/32-stf-client/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/32-stf-client/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/32/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-11-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=32
71 | ENV ANDROID_BUILD_TOOLS_VERSION=32.0.0
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES="build-tools;32.0.0"
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 |
79 |
80 |
81 | ####
82 | # hadolint ignore=DL3008,SC1091
83 | RUN apt-get update \
84 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
85 | && rm -rf /var/lib/apt/lists/* \
86 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
87 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
88 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
89 | && source /usr/local/rvm/scripts/rvm \
90 | && gem install bundler -v '~> 1.0' --force --no-document --default
91 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
92 | ####
93 |
--------------------------------------------------------------------------------
/32/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/32/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/33-emulator/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-11-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=33
71 | ENV ANDROID_BUILD_TOOLS_VERSION=33.0.2
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES="build-tools;33.0.0 build-tools;33.0.1"
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 |
79 | ####
80 | # hadolint ignore=DL3008
81 | RUN apt-get update \
82 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
83 | file \
84 | qt5-default \
85 | libpulse0 \
86 | && rm -rf /var/lib/apt/lists/*
87 |
88 | ENV ANDROID_EMULATOR_PACKAGE="system-images;android-$ANDROID_PLATFORM_VERSION;google_apis_playstore;x86_64"
89 | RUN sdkmanager --verbose "emulator" $ANDROID_EMULATOR_PACKAGE
90 |
91 | # Fix for emulator detect 64bit
92 | ENV SHELL=/bin/bash
93 | # https://www.bram.us/2017/05/12/launching-the-android-emulator-from-the-command-line/
94 | ENV PATH=$ANDROID_SDK_ROOT/emulator:$PATH
95 |
96 | COPY tools-emulator/android-start-emulator /opt/tools/
97 | COPY tools-emulator/android-wait-for-emulator /opt/tools/
98 | RUN adb keygen ~/.android/adbkey
99 | ####
100 |
101 |
102 | ####
103 | # hadolint ignore=DL3008,SC1091
104 | RUN apt-get update \
105 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
106 | && rm -rf /var/lib/apt/lists/* \
107 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
108 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
109 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
110 | && source /usr/local/rvm/scripts/rvm \
111 | && gem install bundler -v '~> 1.0' --force --no-document --default
112 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
113 | ####
114 |
--------------------------------------------------------------------------------
/33-emulator/tools-emulator/android-start-emulator:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | # shellcheck disable=SC2086
5 | avdmanager create avd --package "$ANDROID_EMULATOR_PACKAGE" --name "${AVD_NAME:-test}" --abi "google_apis_playstore/x86_64" --device "${AVD_DEVICE:-pixel}" --force ${AVD_ARGS:-}
6 | # shellcheck disable=SC2086
7 | emulator -avd "${AVD_NAME:-test}" -no-audio -no-boot-anim -no-window -accel on -gpu off ${EMULATOR_ARGS:-} &
8 | android-wait-for-emulator
9 | adb shell input keyevent 82
10 |
--------------------------------------------------------------------------------
/33-emulator/tools-emulator/android-wait-for-emulator:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 | # Originally written by Ralf Kistner , but placed in the public domain
4 |
5 | sleep_time=5
6 | timeout_in_sec=60
7 |
8 | fail_counter=0
9 | until [[ "$(adb -e shell getprop init.svc.bootanim)" =~ "stopped" ]]; do
10 | ((fail_counter += sleep_time))
11 | echo "Waiting for emulator to start (bootanim)"
12 | if [[ $fail_counter -gt timeout_in_sec ]]; then
13 | echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
14 | exit 1
15 | fi
16 | sleep $sleep_time
17 | done
18 |
19 | fail_counter=0
20 | until [[ "$(adb -e shell getprop sys.boot_completed)" == "1" ]]; do
21 | ((fail_counter += sleep_time))
22 | echo "Waiting for emulator to start (boot_completed)"
23 | if [[ $fail_counter -gt timeout_in_sec ]]; then
24 | echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
25 | exit 1
26 | fi
27 | sleep $sleep_time
28 | done
29 |
30 | echo "Emulator is ready"
31 |
--------------------------------------------------------------------------------
/33-emulator/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/33-emulator/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/33-jdk17/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-17-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=33
71 | ENV ANDROID_BUILD_TOOLS_VERSION=33.0.2
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES="build-tools;33.0.0 build-tools;33.0.1"
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 |
79 |
80 |
81 | ####
82 | # hadolint ignore=DL3008,SC1091
83 | RUN apt-get update \
84 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
85 | && rm -rf /var/lib/apt/lists/* \
86 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
87 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
88 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
89 | && source /usr/local/rvm/scripts/rvm \
90 | && gem install bundler -v '~> 1.0' --force --no-document --default
91 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
92 | ####
93 |
--------------------------------------------------------------------------------
/33-jdk17/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/33-jdk17/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/33-ndk/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-11-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=33
71 | ENV ANDROID_BUILD_TOOLS_VERSION=33.0.2
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES="build-tools;33.0.0 build-tools;33.0.1"
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 |
79 |
80 | ####
81 | ENV ANDROID_NDK_PACKAGES="ndk-bundle cmake;3.10.2.4988404 cmake;3.6.4111459 cmake;3.18.1"
82 | ENV ANDROID_NDK_ROOT=$ANDROID_HOME/ndk-bundle
83 | ENV ANDROID_NDK_HOME=$ANDROID_NDK_ROOT
84 | RUN sdkmanager --verbose $ANDROID_NDK_PACKAGES
85 | ####
86 |
87 | ####
88 | # hadolint ignore=DL3008,SC1091
89 | RUN apt-get update \
90 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
91 | && rm -rf /var/lib/apt/lists/* \
92 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
93 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
94 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
95 | && source /usr/local/rvm/scripts/rvm \
96 | && gem install bundler -v '~> 1.0' --force --no-document --default
97 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
98 | ####
99 |
--------------------------------------------------------------------------------
/33-ndk/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/33-ndk/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/33-stf-client/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-11-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=33
71 | ENV ANDROID_BUILD_TOOLS_VERSION=33.0.2
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES="build-tools;33.0.0 build-tools;33.0.1"
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 | ####
79 | # hadolint ignore=DL3008,DL3028,SC2086
80 | RUN apt-get update \
81 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
82 | ruby \
83 | && savedAptMark="$(apt-mark showmanual)" \
84 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
85 | # stf-client
86 | build-essential \
87 | gem \
88 | # Without rake fails to install stf-client
89 | && gem install rake stf-client --no-doc \
90 | && apt-mark auto '.*' > /dev/null \
91 | && apt-mark manual $savedAptMark > /dev/null \
92 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
93 | && rm -rf /var/lib/apt/lists/* \
94 |
95 | RUN adb keygen ~/.android/adbkey
96 | ####
97 |
98 |
99 |
100 | ####
101 | # hadolint ignore=DL3008,SC1091
102 | RUN apt-get update \
103 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
104 | && rm -rf /var/lib/apt/lists/* \
105 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
106 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
107 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
108 | && source /usr/local/rvm/scripts/rvm \
109 | && gem install bundler -v '~> 1.0' --force --no-document --default
110 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
111 | ####
112 |
--------------------------------------------------------------------------------
/33-stf-client/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/33-stf-client/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/33/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-11-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_18.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=33
71 | ENV ANDROID_BUILD_TOOLS_VERSION=33.0.2
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES="build-tools;33.0.0 build-tools;33.0.1"
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 |
79 |
80 |
81 | ####
82 | # hadolint ignore=DL3008,SC1091
83 | RUN apt-get update \
84 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
85 | && rm -rf /var/lib/apt/lists/* \
86 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
87 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
88 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
89 | && source /usr/local/rvm/scripts/rvm \
90 | && gem install bundler -v '~> 1.0' --force --no-document --default
91 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
92 | ####
93 |
--------------------------------------------------------------------------------
/33/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/33/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/34-emulator/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-17-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_20.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_20.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=34
71 | ENV ANDROID_BUILD_TOOLS_VERSION=34.0.0
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES=
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 |
79 | ####
80 | # hadolint ignore=DL3008
81 | RUN apt-get update \
82 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
83 | file \
84 | qt5-default \
85 | libpulse0 \
86 | && rm -rf /var/lib/apt/lists/*
87 |
88 | ENV ANDROID_EMULATOR_PACKAGE="system-images;android-$ANDROID_PLATFORM_VERSION;google_apis_playstore;x86_64"
89 | RUN sdkmanager --verbose "emulator" $ANDROID_EMULATOR_PACKAGE
90 |
91 | # Fix for emulator detect 64bit
92 | ENV SHELL=/bin/bash
93 | # https://www.bram.us/2017/05/12/launching-the-android-emulator-from-the-command-line/
94 | ENV PATH=$ANDROID_SDK_ROOT/emulator:$PATH
95 |
96 | COPY tools-emulator/android-start-emulator /opt/tools/
97 | COPY tools-emulator/android-wait-for-emulator /opt/tools/
98 | RUN adb keygen ~/.android/adbkey
99 | ####
100 |
101 |
102 | ####
103 | # hadolint ignore=DL3008,SC1091
104 | RUN apt-get update \
105 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
106 | && rm -rf /var/lib/apt/lists/* \
107 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
108 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
109 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
110 | && source /usr/local/rvm/scripts/rvm \
111 | && gem install bundler -v '~> 1.0' --force --no-document --default
112 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
113 | ####
114 |
--------------------------------------------------------------------------------
/34-emulator/tools-emulator/android-start-emulator:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | # shellcheck disable=SC2086
5 | avdmanager create avd --package "$ANDROID_EMULATOR_PACKAGE" --name "${AVD_NAME:-test}" --abi "google_apis_playstore/x86_64" --device "${AVD_DEVICE:-pixel}" --force ${AVD_ARGS:-}
6 | # shellcheck disable=SC2086
7 | emulator -avd "${AVD_NAME:-test}" -no-audio -no-boot-anim -no-window -accel on -gpu off ${EMULATOR_ARGS:-} &
8 | android-wait-for-emulator
9 | adb shell input keyevent 82
10 |
--------------------------------------------------------------------------------
/34-emulator/tools-emulator/android-wait-for-emulator:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 | # Originally written by Ralf Kistner , but placed in the public domain
4 |
5 | sleep_time=5
6 | timeout_in_sec=60
7 |
8 | fail_counter=0
9 | until [[ "$(adb -e shell getprop init.svc.bootanim)" =~ "stopped" ]]; do
10 | ((fail_counter += sleep_time))
11 | echo "Waiting for emulator to start (bootanim)"
12 | if [[ $fail_counter -gt timeout_in_sec ]]; then
13 | echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
14 | exit 1
15 | fi
16 | sleep $sleep_time
17 | done
18 |
19 | fail_counter=0
20 | until [[ "$(adb -e shell getprop sys.boot_completed)" == "1" ]]; do
21 | ((fail_counter += sleep_time))
22 | echo "Waiting for emulator to start (boot_completed)"
23 | if [[ $fail_counter -gt timeout_in_sec ]]; then
24 | echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
25 | exit 1
26 | fi
27 | sleep $sleep_time
28 | done
29 |
30 | echo "Emulator is ready"
31 |
--------------------------------------------------------------------------------
/34-emulator/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/34-emulator/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/34-jdk11/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-11-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_20.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_20.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=34
71 | ENV ANDROID_BUILD_TOOLS_VERSION=34.0.0
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES=
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 |
79 |
80 |
81 | ####
82 | # hadolint ignore=DL3008,SC1091
83 | RUN apt-get update \
84 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
85 | && rm -rf /var/lib/apt/lists/* \
86 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
87 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
88 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
89 | && source /usr/local/rvm/scripts/rvm \
90 | && gem install bundler -v '~> 1.0' --force --no-document --default
91 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
92 | ####
93 |
--------------------------------------------------------------------------------
/34-jdk11/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/34-jdk11/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/34-ndk/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-17-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_20.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_20.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=34
71 | ENV ANDROID_BUILD_TOOLS_VERSION=34.0.0
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES=
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 |
79 |
80 | ####
81 | ENV ANDROID_NDK_PACKAGES="ndk-bundle cmake;3.10.2.4988404 cmake;3.6.4111459 cmake;3.18.1"
82 | ENV ANDROID_NDK_ROOT=$ANDROID_HOME/ndk-bundle
83 | ENV ANDROID_NDK_HOME=$ANDROID_NDK_ROOT
84 | RUN sdkmanager --verbose $ANDROID_NDK_PACKAGES
85 | ####
86 |
87 | ####
88 | # hadolint ignore=DL3008,SC1091
89 | RUN apt-get update \
90 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
91 | && rm -rf /var/lib/apt/lists/* \
92 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
93 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
94 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
95 | && source /usr/local/rvm/scripts/rvm \
96 | && gem install bundler -v '~> 1.0' --force --no-document --default
97 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
98 | ####
99 |
--------------------------------------------------------------------------------
/34-ndk/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/34-ndk/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/34-stf-client/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-17-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_20.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_20.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=34
71 | ENV ANDROID_BUILD_TOOLS_VERSION=34.0.0
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES=
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 | ####
79 | # hadolint ignore=DL3008,DL3028,SC2086
80 | RUN apt-get update \
81 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
82 | ruby \
83 | && savedAptMark="$(apt-mark showmanual)" \
84 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
85 | # stf-client
86 | build-essential \
87 | gem \
88 | # Without rake fails to install stf-client
89 | && gem install rake stf-client --no-doc \
90 | && apt-mark auto '.*' > /dev/null \
91 | && apt-mark manual $savedAptMark > /dev/null \
92 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
93 | && rm -rf /var/lib/apt/lists/* \
94 |
95 | RUN adb keygen ~/.android/adbkey
96 | ####
97 |
98 |
99 |
100 | ####
101 | # hadolint ignore=DL3008,SC1091
102 | RUN apt-get update \
103 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
104 | && rm -rf /var/lib/apt/lists/* \
105 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
106 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
107 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
108 | && source /usr/local/rvm/scripts/rvm \
109 | && gem install bundler -v '~> 1.0' --force --no-document --default
110 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
111 | ####
112 |
--------------------------------------------------------------------------------
/34-stf-client/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/34-stf-client/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/34/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-17-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_20.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_20.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=34
71 | ENV ANDROID_BUILD_TOOLS_VERSION=34.0.0
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES=
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 |
79 |
80 |
81 | ####
82 | # hadolint ignore=DL3008,SC1091
83 | RUN apt-get update \
84 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
85 | && rm -rf /var/lib/apt/lists/* \
86 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
87 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
88 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
89 | && source /usr/local/rvm/scripts/rvm \
90 | && gem install bundler -v '~> 1.0' --force --no-document --default
91 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
92 | ####
93 |
--------------------------------------------------------------------------------
/34/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/34/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/Dockerfile.template:
--------------------------------------------------------------------------------
1 | FROM ubuntu:focal
2 | SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3 |
4 | # hadolint ignore=DL3008
5 | RUN apt-get update \
6 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7 | expect \
8 | locales \
9 | nano \
10 | openjdk-%%JDK_VERSION%%-jdk \
11 | unzip \
12 | curl \
13 | xz-utils \
14 | git \
15 | && rm -rf /var/lib/apt/lists/*
16 |
17 | # Seems somethings build better with utf8 locale specified
18 | # http://jaredmarkell.com/docker-and-locales/
19 | # https://github.com/square/moshi/issues/804#issuecomment-466926878
20 | RUN locale-gen en_US.UTF-8
21 | ENV LANG=en_US.UTF-8
22 | ENV LANGUAGE=en_US:en
23 | ENV LC_ALL=en_US.UTF-8
24 |
25 | ####
26 | # hadolint ignore=DL3008
27 | RUN apt-get update \
28 | && apt-get install -y --no-install-recommends \
29 | apt-transport-https \
30 | gnupg \
31 | lsb-release \
32 | # For nodejs we use nodesource, its nice and easy and gets us the correct version
33 | # Find latest link https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
34 | && curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
35 | && echo "deb https://deb.nodesource.com/node_%%NODE_VARIANT%%.x $(lsb_release -s -c) main" | tee /etc/apt/sources.list.d/nodesource.list \
36 | && echo "deb-src https://deb.nodesource.com/node_%%NODE_VARIANT%%.x $(lsb_release -s -c) main" | tee -a /etc/apt/sources.list.d/nodesource.list \
37 | && apt-get update \
38 | && apt-get install -y --no-install-recommends \
39 | nodejs \
40 | && rm -rf /var/lib/apt/lists/*
41 |
42 | # hadolint ignore=DL3016
43 | RUN npm -g install xcode-build-tools yarn
44 | ####
45 |
46 | # Install the SDK
47 | # https://developer.android.com/studio#downloads
48 | ENV ANDROID_CMDLINE_TOOLS=https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
49 | # hadolint ignore=DL3003
50 | RUN ( \
51 | cd /opt \
52 | && mkdir android-sdk-linux \
53 | && curl -sSL -o cmdline-tools.zip "$ANDROID_CMDLINE_TOOLS" \
54 | && unzip cmdline-tools.zip -d android-sdk-linux/cmdline-tools \
55 | && rm -f cmdline-tools.zip \
56 | && chown -R root:root android-sdk-linux \
57 | )
58 |
59 | ENV ANDROID_SDK_ROOT=/opt/android-sdk-linux
60 | ENV ANDROID_HOME=$ANDROID_SDK_ROOT
61 | ENV PATH=$ANDROID_HOME/cmdline-tools/cmdline-tools/bin:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/tools/bin:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH
62 |
63 | # Install custom tools
64 | COPY tools/license_accepter /opt/tools/
65 | COPY tools/adb-all /opt/tools
66 | ENV PATH=/opt/tools:$PATH
67 | RUN license_accepter
68 |
69 | # Install Android platform and things
70 | ENV ANDROID_PLATFORM_VERSION=%%VARIANT%%
71 | ENV ANDROID_BUILD_TOOLS_VERSION=%%BUILD_TOOLS%%
72 | ENV PATH=$ANDROID_SDK_ROOT/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
73 | ENV ANDROID_EXTRA_PACKAGES=%%EXTRA_PACKAGES%%
74 | ENV ANDROID_REPOSITORIES="extras;android;m2repository extras;google;m2repository"
75 | ENV ANDROID_CONSTRAINT_PACKAGES="extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1 extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0"
76 | RUN sdkmanager --verbose "platform-tools" "platforms;android-$ANDROID_PLATFORM_VERSION" "build-tools;$ANDROID_BUILD_TOOLS_VERSION" $ANDROID_EXTRA_PACKAGES $ANDROID_REPOSITORIES $ANDROID_CONSTRAINT_PACKAGES
77 |
78 | ####
79 | # hadolint ignore=DL3008,DL3028,SC2086
80 | RUN apt-get update \
81 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
82 | ruby \
83 | && savedAptMark="$(apt-mark showmanual)" \
84 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
85 | # stf-client
86 | build-essential \
87 | gem \
88 | # Without rake fails to install stf-client
89 | && gem install rake stf-client --no-doc \
90 | && apt-mark auto '.*' > /dev/null \
91 | && apt-mark manual $savedAptMark > /dev/null \
92 | && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
93 | && rm -rf /var/lib/apt/lists/* \
94 |
95 | RUN adb keygen ~/.android/adbkey
96 | ####
97 |
98 | ####
99 | # hadolint ignore=DL3008
100 | RUN apt-get update \
101 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
102 | file \
103 | qt5-default \
104 | libpulse0 \
105 | && rm -rf /var/lib/apt/lists/*
106 |
107 | ENV ANDROID_EMULATOR_PACKAGE="system-images;android-$ANDROID_PLATFORM_VERSION;google_apis_playstore;x86_64"
108 | RUN sdkmanager --verbose "emulator" $ANDROID_EMULATOR_PACKAGE
109 |
110 | # Fix for emulator detect 64bit
111 | ENV SHELL=/bin/bash
112 | # https://www.bram.us/2017/05/12/launching-the-android-emulator-from-the-command-line/
113 | ENV PATH=$ANDROID_SDK_ROOT/emulator:$PATH
114 |
115 | COPY tools-emulator/android-start-emulator /opt/tools/
116 | COPY tools-emulator/android-wait-for-emulator /opt/tools/
117 | RUN adb keygen ~/.android/adbkey
118 | ####
119 |
120 | ####
121 | ENV ANDROID_NDK_PACKAGES="ndk-bundle cmake;3.10.2.4988404 cmake;3.6.4111459 cmake;3.18.1"
122 | ENV ANDROID_NDK_ROOT=$ANDROID_HOME/ndk-bundle
123 | ENV ANDROID_NDK_HOME=$ANDROID_NDK_ROOT
124 | RUN sdkmanager --verbose $ANDROID_NDK_PACKAGES
125 | ####
126 |
127 | ####
128 | # hadolint ignore=DL3008,SC1091
129 | RUN apt-get update \
130 | && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 \
131 | && rm -rf /var/lib/apt/lists/* \
132 | && gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
133 | && curl -sSL https://get.rvm.io | bash -s stable --ruby --without-gems="rvm rubygems-bundler" \
134 | && echo -e "source /usr/local/rvm/scripts/rvm\n$(cat /etc/bash.bashrc)" >/etc/bash.bashrc \
135 | && source /usr/local/rvm/scripts/rvm \
136 | && gem install bundler -v '~> 1.0' --force --no-document --default
137 | ENV BASH_ENV="/usr/local/rvm/scripts/rvm"
138 | ####
139 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Fred Cox
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Android docker image
2 |
3 | An image that lets us build android apps with docker using gitlab-ci
4 |
5 | ## Tags available
6 |
7 | * `34`
8 | * `34-emulator`
9 | * `34-ndk`
10 | * `34-stf-client`
11 | * `34-jdk11`
12 | * `33`
13 | * `33-emulator`
14 | * `33-ndk`
15 | * `33-stf-client`
16 | * `33-jdk17`
17 | * `32`
18 | * `32-emulator`
19 | * `32-ndk`
20 | * `32-stf-client`
21 | * `32-jdk17`
22 |
23 | ## Unmaintained tags
24 |
25 | * `31`
26 | * `31-emulator`
27 | * `31-ndk`
28 | * `31-stf-client`
29 | * `30`
30 | * `30-emulator`
31 | * `30-ndk`
32 | * `30-stf-client`
33 | * `30-ruby-bundler` (ruby included in all builds now)
34 | * `31-ruby-bundler`
35 | * `29`
36 | * `29-emulator`
37 | * `29-ndk`
38 | * `29-stf-client`
39 | * `29-ruby-bundler`
40 | * `28`
41 | * `28-emulator`
42 | * `28-ndk`
43 | * `28-stf-client`
44 |
45 | ## Build an app
46 |
47 | ```bash
48 | docker run -ti --rm --volume=$(pwd):/srv -w /srv ekreative/android ./gradlew assemble
49 | ```
50 |
51 | ## Use emulator
52 |
53 | ```bash
54 | docker run --rm -ti -v /dev/kvm:/dev/kvm --privileged ekreative/android
55 | android-start-emulator
56 | /gradlew cAT
57 | ```
58 |
59 | ## Contributing
60 |
61 | This repo stores commited versions of Dockerfiles generated using the `./update.sh` script.
62 | To update the Dockerfiles, run `./update.sh` and commit the changes.
63 | When adding new versions remember to update the github workflow so that it builds them all.
64 | I tend to remove an older version when adding a new one. To keep just the last 2-3 versions being built. Remove old
65 | versions from the `Dockerfile`.
66 | You should also update the list of tags in the README.md file.
67 |
68 | ## Credit
69 |
70 | Borrowed a few ideas from [jacekmarchwicki/android](https://hub.docker.com/r/jacekmarchwicki/android/)
71 | And license accepter from [thyrlian/AndroidSDK](https://github.com/thyrlian/AndroidSDK/blob/master/android-sdk/license_accepter.sh)
72 |
73 | ## Finding new packages
74 |
75 | I use this command to list the available packages
76 |
77 | ```bash
78 | sdkmanager --list
79 | ```
80 |
--------------------------------------------------------------------------------
/tools-emulator/android-start-emulator:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | # shellcheck disable=SC2086
5 | avdmanager create avd --package "$ANDROID_EMULATOR_PACKAGE" --name "${AVD_NAME:-test}" --abi "google_apis_playstore/x86_64" --device "${AVD_DEVICE:-pixel}" --force ${AVD_ARGS:-}
6 | # shellcheck disable=SC2086
7 | emulator -avd "${AVD_NAME:-test}" -no-audio -no-boot-anim -no-window -accel on -gpu off ${EMULATOR_ARGS:-} &
8 | android-wait-for-emulator
9 | adb shell input keyevent 82
10 |
--------------------------------------------------------------------------------
/tools-emulator/android-wait-for-emulator:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 | # Originally written by Ralf Kistner , but placed in the public domain
4 |
5 | sleep_time=5
6 | timeout_in_sec=60
7 |
8 | fail_counter=0
9 | until [[ "$(adb -e shell getprop init.svc.bootanim)" =~ "stopped" ]]; do
10 | ((fail_counter += sleep_time))
11 | echo "Waiting for emulator to start (bootanim)"
12 | if [[ $fail_counter -gt timeout_in_sec ]]; then
13 | echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
14 | exit 1
15 | fi
16 | sleep $sleep_time
17 | done
18 |
19 | fail_counter=0
20 | until [[ "$(adb -e shell getprop sys.boot_completed)" == "1" ]]; do
21 | ((fail_counter += sleep_time))
22 | echo "Waiting for emulator to start (boot_completed)"
23 | if [[ $fail_counter -gt timeout_in_sec ]]; then
24 | echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
25 | exit 1
26 | fi
27 | sleep $sleep_time
28 | done
29 |
30 | echo "Emulator is ready"
31 |
--------------------------------------------------------------------------------
/tools/adb-all:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Script adb-all
3 | # Taken from https://stackoverflow.com/a/8672540/859027
4 | # Usage
5 | # You can run any command adb provide on all your current devices
6 | # ./adb-all is the equivalent of ./adb -s
7 | #
8 | # Examples
9 | # ./adb-all version
10 | # ./adb-all install apidemo.apk
11 | # ./adb-all uninstall com.example.android.apis
12 |
13 | adb devices | while read -r line; do
14 | if [ ! "$line" = "" ] && [ "$(echo "$line" | awk '{print $2}')" = "device" ]; then
15 | device=$(echo "$line" | awk '{print $1}')
16 | echo "$device $* ..."
17 | adb -s "$device" "$@"
18 | fi
19 | done
20 |
--------------------------------------------------------------------------------
/tools/license_accepter:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | check_android_sdk_root() {
4 | if [ "$#" -lt 1 ]; then
5 | if [ -z "${ANDROID_SDK_ROOT}" ]; then
6 | echo "Please either set ANDROID_SDK_ROOT environment variable, or pass ANDROID_SDK_ROOT directory as a parameter"
7 | exit 1
8 | fi
9 | else
10 | ANDROID_SDK_ROOT=$1
11 | fi
12 | echo "ANDROID_SDK_ROOT is at $ANDROID_SDK_ROOT"
13 | }
14 |
15 | accept_all_android_licenses() {
16 | ANDROID_LICENSES="$ANDROID_SDK_ROOT/licenses"
17 | if [ ! -d "$ANDROID_LICENSES" ]; then
18 | echo "Android licenses directory doesn't exist, creating one..."
19 | mkdir -p "$ANDROID_LICENSES"
20 | fi
21 | accept_license_of android-sdk-license 8933bad161af4178b1185d1a37fbf41ea5269c55
22 | accept_license_of android-sdk-license d56f5187479451eabf01fb78af6dfcb131a6481e
23 | accept_license_of android-sdk-license 24333f8a63b6825ea9c5514f83c2829b004d1fee
24 | accept_license_of android-sdk-preview-license 84831b9409646a918e30573bab4c9c91346d8abd
25 | accept_license_of intel-android-extra-license d975f751698a77b662f1254ddbeed3901e976f5a
26 | accept_license_of android-sdk-arm-dbt-license 859f317696f67ef3d7f30a50a5560e7834b43903
27 | }
28 |
29 | accept_license_of() {
30 | local license=$1
31 | local content=$2
32 | local file=$ANDROID_LICENSES/$license
33 | if [ -f "$file" ]; then
34 | if grep -q "^$content$" "$file"; then
35 | echo "$license: $content has been accepted already"
36 | else
37 | echo "Accepting $license: $content ..."
38 | echo -e "$content" >>"$file"
39 | fi
40 | else
41 | echo "Accepting $license: $content ..."
42 | echo -e "$content" >"$file"
43 | fi
44 | }
45 |
46 | check_android_sdk_root "$@"
47 | accept_all_android_licenses
48 |
--------------------------------------------------------------------------------
/update.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -e
3 |
4 | variants=('32' '33' '34')
5 |
6 | ## Disabled creating extra node variants, rather just having a default for each SDK
7 | #node_variants=('14' '18')
8 | declare -A default_node_variants=(
9 | ['32']='18'
10 | ['33']='18'
11 | ['34']='20'
12 | )
13 |
14 | jdk_variants=('11' '17')
15 | declare -A default_jdk_variants=(
16 | ['32']='11'
17 | ['33']='11'
18 | ['34']='17'
19 | )
20 |
21 | declare -A build_tools=(
22 | ['32']='32.0.0'
23 | ['33']='33.0.2'
24 | ['34']='34.0.0'
25 | )
26 |
27 | declare -A extra_packages=(
28 | ['32']='"build-tools;32.0.0"'
29 | ['33']='"build-tools;33.0.0 build-tools;33.0.1"'
30 | ['34']=''
31 | )
32 |
33 | for variant in "${variants[@]}"; do
34 | # for node_variant in "${node_variants[@]}"; do
35 | for jdk_variant in "${jdk_variants[@]}"; do
36 | for type in 'default' 'emulator' 'ndk' 'stf-client'; do
37 | template="Dockerfile.template"
38 | default_node_variant="${default_node_variants[$variant]}"
39 | default_jdk_variant="${default_jdk_variants[$variant]}"
40 | node_variant="$default_node_variant"
41 | if [ "$type" != "default" ]; then
42 | dir="$variant-$type"
43 | if [ "$node_variant" != "$default_node_variant" ]; then
44 | break 1
45 | fi
46 | if [ "$jdk_variant" != "$default_jdk_variant" ]; then
47 | break 1
48 | fi
49 | else
50 | dir="$variant"
51 | if [ "$node_variant" != "$default_node_variant" ] && [ "$jdk_variant" != "$default_jdk_variant" ]; then
52 | break 1
53 | fi
54 | fi
55 |
56 | if [ "$node_variant" != "$default_node_variant" ]; then
57 | dir="$dir-node$node_variant"
58 | fi
59 |
60 | if [ "$jdk_variant" != "$default_jdk_variant" ]; then
61 | dir="$dir-jdk$jdk_variant"
62 | fi
63 |
64 | echo "$dir"
65 |
66 | rm -rf "$dir"
67 | mkdir -p "$dir"
68 | cp -r tools/ "$dir/tools/"
69 |
70 | extra_sed=''
71 | if [ "$type" = "emulator" ]; then
72 | cp -r tools-emulator/ "$dir/tools-emulator/"
73 | else
74 | extra_sed='
75 | '"$extra_sed"'
76 | /####/,/##<\/emulator>##/d;
77 | '
78 | fi
79 | if [ "$type" != "ndk" ]; then
80 | extra_sed='
81 | '"$extra_sed"'
82 | /####/,/##<\/ndk>##/d;
83 | '
84 | fi
85 | if [ "$type" != "stf-client" ]; then
86 | extra_sed='
87 | '"$extra_sed"'
88 | /####/,/##<\/stf-client>##/d;
89 | '
90 | fi
91 | sed -E '
92 | '"$extra_sed"'
93 | s/%%VARIANT%%/'"$variant"'/;
94 | s/%%NODE_VARIANT%%/'"$node_variant"'/;
95 | s/%%BUILD_TOOLS%%/'"${build_tools[$variant]}"'/;
96 | s/%%EXTRA_PACKAGES%%/'"${extra_packages[$variant]}"'/;
97 | s/%%JDK_VERSION%%/'"$jdk_variant"'/;
98 | ' $template >"$dir/Dockerfile"
99 | done
100 | done
101 | # done
102 | done
103 |
--------------------------------------------------------------------------------