Skip to content

Switch to a JRE 23 base image on Alpine#29

Open
craigminihan wants to merge 3 commits intoVacxe:masterfrom
craigminihan:alpine-base-image
Open

Switch to a JRE 23 base image on Alpine#29
craigminihan wants to merge 3 commits intoVacxe:masterfrom
craigminihan:alpine-base-image

Conversation

@craigminihan
Copy link

@craigminihan craigminihan commented Feb 20, 2026

Great project! I plan to make use of it from my GH workflows. This PR contains a few quality of life changes, so nothing critical and no new features.

I've made a number of changes to the Dockerfile as follows:

  • Use eclipse-temurin:23-jre-alpine as the base image
  • Added a multi-stage build so wget and any other build-time tools don't end up on the final image
  • Extracted the tar to /opt rather than /usr/local and soft linked google-play-cli into /usr/local/bin which is on the path by default
  • Set google-play-cli as the entrypoint

Advantages

  • the Alpine JRE image is much smaller than the Noble JDK image and has no critical vulnerabilities
  • build time tools don't appear in the final image since they can introduce unwanted vulnerabilities
  • the final image is 236MB compared to 509MB
  • the container directly accepts the app command line parameters, this is more natural than updating the path and requiring the user to supply the app name when invoking the container

For example when invoking this version you'd use docker run -ti --rm vacxe/google-play-cli to see help rather than docker run -ti --rm vacxe/google-play-cli google-play-cli --help.

You can see the same approach to Dockerfile structure in the anchore/grype image which is a great free image scanning tool, for example: https://github.com/anchore/grype/blob/9d54499415ad6f34426ce82082fa205a2e6bc45a/Dockerfile#L29 shows the entrypoint behaviour.

... plus use a multi-stage build to remove wget from the final image
Dockerfile Outdated
@@ -1,15 +1,24 @@
FROM eclipse-temurin:23-jdk
FROM eclipse-temurin:25-jre-alpine AS builder
Copy link
Author

@craigminihan craigminihan Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use OpenJDK JRE version 23 on Alpine, note the Dockerfile is using multi-stage builds now

RUN apt-get update
RUN apt-get install -y wget unzip jq
RUN apk update && \
apk add wget
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only add wget since AFAIK jq and unzip aren't required??

RUN wget -q "https://github.com/Vacxe/google-play-cli-kt/releases/download/$PLAY_CLI_VERSION/google-play-cli.tar" && \
tar -xvf "google-play-cli.tar" -C /usr/local && \
RUN wget -q "https://github.com/Vacxe/google-play-cli-kt/releases/download/${PLAY_CLI_VERSION}/google-play-cli.tar" && \
tar -xvf "google-play-cli.tar" -C /opt && \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

untar to /opt now


RUN echo "CLI version:" && google-play-cli version
# copy the cli binaries
COPY --from=builder /opt/google-play-cli /opt/google-play-cli
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy in the binaries from the temporary builder image

COPY --from=builder /opt/google-play-cli /opt/google-play-cli

# soft link the cli to /usr/local/bin and check it works ok
RUN ln -s /opt/google-play-cli/bin/google-play-cli /usr/local/bin/google-play-cli && \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

soft link google-play-cli into /usr/local/bin which is on the path already

echo "CLI version:" && google-play-cli version

# set the entrypoint to the cli and default args to `--help`
ENTRYPOINT [ "google-play-cli" ]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a breaking change: set the entrypoint to google-play-cli to execute automatically when docker run is used

@craigminihan craigminihan changed the title Switch to a JRE 25 base image on Alpine Switch to a JRE 25 based image on Alpine Feb 20, 2026
@craigminihan craigminihan changed the title Switch to a JRE 25 based image on Alpine Switch to a JRE 25 base image on Alpine Feb 20, 2026

# set the entrypoint to the cli and default args to `--help`
ENTRYPOINT [ "google-play-cli" ]
CMD [ "--help" ]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set the default command line args to --help, if the user specifies anything else that will be used instead

@craigminihan craigminihan changed the title Switch to a JRE 25 base image on Alpine Switch to a JRE 23 base image on Alpine Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant