Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/helpers/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM ubuntu:bionic-20200219 AS tmp
WORKDIR /build
RUN apt-get update && apt-get install -y curl wget zip

RUN ARCH=$(dpkg --print-architecture) && \
if [ "$ARCH" = "amd64" ]; then \
wget -O jre.zip https://github.com/supertokens/jre/raw/refs/heads/master/jre-15.0.1-linux.zip; \
elif [ "$ARCH" = "arm64" ]; then \
wget -O jre.zip https://github.com/supertokens/jre/raw/refs/heads/master/jre-15.0.1-linux-arm.zip; \
else \
echo "Unsupported architecture: $ARCH" && exit 1; \
fi
RUN unzip jre.zip
RUN mv jre-15.0.1 jre || mv jre-15.0.1-linux-aarch/jre-15.0.1 jre
Copy link

Choose a reason for hiding this comment

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

The ARM JRE extraction path appears inconsistent with the download URL. The command attempts to use jre-15.0.1-linux-aarch/jre-15.0.1 but the download URL uses -linux-arm. Consider updating the extraction path to match the archive structure, likely jre-15.0.1-linux-arm/jre-15.0.1 or simply jre-15.0.1-linux-arm. This mismatch could cause Docker build failures on ARM architectures.

Suggested change
RUN mv jre-15.0.1 jre || mv jre-15.0.1-linux-aarch/jre-15.0.1 jre
RUN mv jre-15.0.1 jre || mv jre-15.0.1-linux-arm/jre-15.0.1 jre

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

ADD ./cli ./cli
ADD ./core ./core
ADD ./plugin-interface ./plugin-interface
ADD ./plugin ./plugin
ADD ./ee ./ee
ADD ./config.yaml ./config.yaml
ADD ./version.yaml ./version.yaml

RUN ls && ./jre/bin/java -classpath "./cli/*" io.supertokens.cli.Main true $@

FROM debian:bookworm-slim
RUN groupadd supertokens && useradd -m -s /bin/bash -g supertokens supertokens
RUN apt-get update && apt-get install -y --no-install-recommends gnupg dirmngr curl && rm -rf /var/lib/apt/lists/*
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
ENV GOSU_VERSION=1.7
RUN set -x \
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& gpgconf --kill all \
&& rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& apt-get purge -y --auto-remove wget
COPY --from=tmp --chown=supertokens /usr/lib/supertokens /usr/lib/supertokens
COPY --from=tmp --chown=supertokens /usr/bin/supertokens /usr/bin/supertokens
COPY ./supertokens-postgresql-plugin/.github/helpers/docker/docker-entrypoint.sh /usr/local/bin/
RUN echo "$(md5sum /usr/lib/supertokens/config.yaml | awk '{ print $1 }')" >> /CONFIG_HASH
RUN ln -s /usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
EXPOSE 3567
USER "supertokens"
ENTRYPOINT ["/entrypoint.sh"]
CMD ["supertokens", "start"]
Loading
Loading