diff --git a/Dockerfile b/Dockerfile index 714da5e..2e0ad55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,8 @@ # Fetch & build stage ######################################################### # ARGS -ARG BUILDER_IMAGE_TAG='17-jdk-jammy' -ARG RUNTIME_IMAGE_TAG='17-jdk-jammy' +ARG BUILDER_IMAGE_TAG='21-jdk-noble' +ARG RUNTIME_IMAGE_TAG='21-jre-noble' # Base image FROM eclipse-temurin:${BUILDER_IMAGE_TAG} AS builder @@ -16,7 +16,8 @@ WORKDIR /build COPY . /build # Build -RUN chmod u+x ./gradlew && ./gradlew installDist +RUN set -x && \ + chmod u+x ./gradlew && ./gradlew installDist # Runtime stage ############################################################### # Base image @@ -29,13 +30,12 @@ ENV CITYDB_TOOL_VERSION=${CITYDB_TOOL_VERSION} # Copy from builder COPY --from=builder /build/citydb-cli/build/install/citydb-tool /opt/citydb-tool -# Run as non-root user, put start script in path and set permissions -RUN groupadd --gid 1000 -r citydb-tool && \ - useradd --uid 1000 --gid 1000 -d /data -m -r --no-log-init citydb-tool && \ +# Put start script in path +RUN set -x && \ ln -sf /opt/citydb-tool/citydb /usr/local/bin -WORKDIR /data USER 1000 +WORKDIR /data ENTRYPOINT ["citydb"] CMD ["--help"]