diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..90d4b8f6436e8b3b0ef4e1977df6aa5caea6bc09 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,44 @@ +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