Compare commits

...

8 Commits

Author SHA1 Message Date
surtur ad7d97e62b
bump build-tools to 33.0.0
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-10 15:54:35 +02:00
surtur 0b5de1fbbd
bump build-tools to 33.0.0-rc2
Some checks failed
continuous-integration/drone/push Build is failing
2022-04-01 22:10:24 +02:00
surtur 4c4d12598d
makefile: add build args [skip ci] 2022-04-01 21:07:59 +02:00
surtur fe3ebc6d83
bump kaniko executor version to v1.8.0-debug
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-01 21:06:07 +02:00
surtur acf1d19c64
specify the registry path of the images
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-01 20:21:47 +02:00
surtur 802d712ace
bump docker 'frontend' to version 1.3
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-01 20:18:34 +02:00
surtur 5263bfaa8f
dockerfile: consolidate multiple RUN statements
All checks were successful
continuous-integration/drone/push Build is passing
..to achieve faster builds
2022-04-01 19:40:55 +02:00
surtur 8f6fdd8b0d
chore: switch all ANDROID_SDK_ROOT to ANDROID_HOME
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-16 03:52:38 +02:00
3 changed files with 39 additions and 39 deletions

View File

@ -1,9 +1,9 @@
# syntax=docker/dockerfile:1.2
# syntax=docker/dockerfile:1.3
# refs:
# https://docs.docker.com/develop/develop-images/build_enhancements/#overriding-default-frontends
# https://pythonspeed.com/articles/docker-buildkit/
FROM frolvlad/alpine-java:jdk8-full as build
FROM docker.io/frolvlad/alpine-java:jdk8-full as build
ARG BUILD_DATE
ARG VCS_REF
@ -19,58 +19,56 @@ ENV VERSION_TOOLS "6609375"
ENV ANDROID_HOME "/tmp/sdk"
ENV ANDROID_SDK_ROOT "${ANDROID_HOME}"
RUN apk update
RUN apk add --no-cache binutils ca-certificates curl git openssl unzip --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
WORKDIR /tmp
RUN curl -o sdk.zip -s https://dl.google.com/android/repository/sdk-tools-linux-"${VERSION_SDK_TOOLS}".zip
RUN unzip ./sdk.zip -d "${ANDROID_SDK_ROOT}"
RUN rm -f ./sdk.zip
RUN apk update && \
apk add --no-cache binutils ca-certificates curl git openssl unzip --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing && \
\
curl -o sdk.zip -s https://dl.google.com/android/repository/sdk-tools-linux-"${VERSION_SDK_TOOLS}".zip && \
unzip ./sdk.zip -d "${ANDROID_HOME}" && \
rm -f ./sdk.zip && \
\
curl -o tools.zip -s https://dl.google.com/android/repository/commandlinetools-linux-"${VERSION_TOOLS}"_latest.zip \
&& mkdir -p "${ANDROID_HOME}"/cmdline-tools \
&& unzip ./tools.zip -d "${ANDROID_HOME}"/cmdline-tools \
&& rm -v ./tools.zip && \
\
mkdir -p $ANDROID_HOME/licenses/ \
&& echo "8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > $ANDROID_HOME/licenses/android-sdk-license \
&& echo "84831b9409646a918e30573bab4c9c91346d8abd\n504667f4c0de7af1a06de9f4b1727b84351f2910" > $ANDROID_HOME/licenses/android-sdk-preview-license \
&& yes | ${ANDROID_HOME}/cmdline-tools/tools/bin/sdkmanager --sdk_root=${ANDROID_HOME} --licenses >/dev/null
RUN curl -o tools.zip -s https://dl.google.com/android/repository/commandlinetools-linux-"${VERSION_TOOLS}"_latest.zip \
&& mkdir -p "${ANDROID_SDK_ROOT}"/cmdline-tools \
&& unzip ./tools.zip -d "${ANDROID_SDK_ROOT}"/cmdline-tools \
&& rm -v ./tools.zip
COPY packages.txt "${ANDROID_HOME}"
RUN mkdir -p /"$(whoami)"/.android && \
touch /"$(whoami)"/.android/repositories.cfg && \
\
yes | "${ANDROID_HOME}"/tools/bin/sdkmanager --verbose --licenses && \
"${ANDROID_HOME}"/tools/bin/sdkmanager --verbose --update && \
\
while read -r package; do PACKAGES="${PACKAGES}${package} "; done < "${ANDROID_HOME}"/packages.txt && ${ANDROID_HOME}/tools/bin/sdkmanager --verbose ${PACKAGES}
RUN mkdir -p $ANDROID_SDK_ROOT/licenses/ \
&& echo "8933bad161af4178b1185d1a37fbf41ea5269c55\nd56f5187479451eabf01fb78af6dfcb131a6481e\n24333f8a63b6825ea9c5514f83c2829b004d1fee" > $ANDROID_SDK_ROOT/licenses/android-sdk-license \
&& echo "84831b9409646a918e30573bab4c9c91346d8abd\n504667f4c0de7af1a06de9f4b1727b84351f2910" > $ANDROID_SDK_ROOT/licenses/android-sdk-preview-license \
&& yes | ${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --licenses >/dev/null
COPY packages.txt "${ANDROID_SDK_ROOT}"
RUN mkdir -p /"$(whoami)"/.android
RUN touch /"$(whoami)"/.android/repositories.cfg
RUN yes | "${ANDROID_SDK_ROOT}"/tools/bin/sdkmanager --verbose --licenses
RUN "${ANDROID_SDK_ROOT}"/tools/bin/sdkmanager --verbose --update
RUN while read -r package; do PACKAGES="${PACKAGES}${package} "; done < "${ANDROID_SDK_ROOT}"/packages.txt && ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --verbose ${PACKAGES}
FROM adoptopenjdk/openjdk11:alpine-slim
FROM docker.io/adoptopenjdk/openjdk11:alpine-slim
COPY --from=build /tmp/sdk /sdk
# Makes JVM aware of memory limit available to the container (cgroups)
ENV JAVA_OPTS='-XX:+UseContainerSupport -XX:MaxRAMPercentage=80'
ENV ANDROID_HOME "/sdk"
ENV ANDROID_SDK_ROOT "${ANDROID_SDK_ROOT}"
ENV PATH "$PATH:${ANDROID_SDK_ROOT}/tools:${ANDROID_HOME}/tools"
ENV ANDROID_SDK_ROOT "${ANDROID_HOME}"
ENV PATH "$PATH:${ANDROID_HOME}/tools"
ENV ASDF_VERSION "v0.8.1"
ENV GRADLE_VERSION "7.1"
RUN apk add --no-cache bash curl git vim xz --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
# gradle pls
RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch "${ASDF_VERSION}" \
RUN apk add --no-cache bash curl git vim xz --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
&& git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch "${ASDF_VERSION}" \
&& sed -i 's/\/bin\/ash/\/bin\/bash/' /etc/passwd && cat /etc/passwd \
&& echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc \
&& echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc \
&& bash -c ". ~/.bashrc; ~/.asdf/bin/asdf plugin-add gradle https://github.com/rfrancis/asdf-gradle.git" \
&& bash -c ". ~/.bashrc; ~/.asdf/bin/asdf install gradle ${GRADLE_VERSION}" \
&& bash -c ". ~/.bashrc; ~/.asdf/bin/asdf global gradle ${GRADLE_VERSION}" \
&& bash -c ". ~/.bashrc; ~/.asdf/shims/gradle --version"
RUN ln -svf /bin/bash /bin/sh \
&& bash -c ". ~/.bashrc; ~/.asdf/shims/gradle --version" && \
\
ln -svf /bin/bash /bin/sh \
&& ls -la /bin/*sh \
&& echo -e "\n. ~/.bashrc" >> ~/.bash_profile

View File

@ -5,10 +5,12 @@ dargs = build -t $(dtag) --no-cache --pull .
cleanargs = image rm -f $(dtag)
pruneargs = system prune -af
dargskaniko = run --rm -it -w=$(kanikowdir) -v $$PWD:$(kanikowdir)
kanikoexecutorimg = gcr.io/kaniko-project/executor
kanikoexecutorimg = gcr.io/kaniko-project/executor:v1.8.0-debug
kanikowdir = /src
kanikocontext = .
kanikoargs = -f=$(dfile) -c=$(kanikocontext) --use-new-run --snapshotMode=redo --no-push --force
kanikoargs = -f=$(dfile) -c=$(kanikocontext) --use-new-run --snapshotMode=redo --build-arg BUILD_DATE=$(build_date) --build-arg VCS_REF=$(vcs_ref) --no-push
vcs_ref = $$(git rev-parse --short HEAD)
build_date= $$(date -u +"%Y-%m-%dT%H:%M:%SZ")
.PHONY: build kaniko clean test prune

View File

@ -1,4 +1,4 @@
build-tools;30.0.2
build-tools;33.0.0
extras;android;m2repository
extras;google;m2repository
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2