Skip to content
Snippets Groups Projects
Commit 6a9bc7fe authored by Andri Joos's avatar Andri Joos :blush:
Browse files

add Dockerfile

parent 4823556a
No related branches found
No related tags found
No related merge requests found
ARG DEPENDENCY_DIR="/tmp/dependencies"
ARG BUNDLETOOL_DIR="bundletool"
ARG BUNDLETOOL_FILENAME="bundletool.jar"
FROM ubuntu:24.04 AS download
ARG DEPENDENCY_DIR
ARG BUNDLETOOL_DIR
ARG BUNDLETOOL_FILENAME
ARG BUNDLETOOL_DIR="${DEPENDENCY_DIR}/${BUNDLETOOL_DIR}"
ARG BUNDLETOOL_FILE="${BUNDLETOOL_DIR}/${BUNDLETOOL_FILENAME}"
ARG BUNDLETOOL_VERSION="1.17.2"
RUN apt update \
&& apt install -y wget
RUN mkdir -p ${BUNDLETOOL_DIR} \
&& wget "https://github.com/google/bundletool/releases/download/${BUNDLETOOL_VERSION}/bundletool-all-${BUNDLETOOL_VERSION}.jar" -O ${BUNDLETOOL_FILE}
FROM alpine:3
ARG DEPENDENCY_DIR
ARG USER_UID="1000"
ARG USER_GID=$USER_UID
ARG USERNAME="bundletool"
ARG BUNDLETOOL_DIR
ARG BUNDLETOOL_FILENAME
ARG BUNDLETOOL_DIR="/${BUNDLETOOL_DIR}"
ARG BUNDLETOOL_FILE="${BUNDLETOOL_DIR}/${BUNDLETOOL_FILENAME}"
ARG BUNDLETOOL_BIN=/bin/bundletool
COPY --from=download ${DEPENDENCY_DIR} /
RUN apk add --no-cache bash openjdk17-jdk \
&& addgroup ${USERNAME} -g ${USER_GID} \
&& adduser ${USERNAME} --uid ${USER_UID} --ingroup ${USERNAME} --disabled-password \
&& echo -e '#!/bin/bash\njava -jar '"$BUNDLETOOL_FILE"' "$@"' > ${BUNDLETOOL_BIN} \
&& chmod +x ${BUNDLETOOL_BIN}
USER ${USERNAME}
# Test
# RUN bash /bin/bundletool --help && exit 1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment