Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker base image updates #44

Merged
merged 5 commits into from
Nov 18, 2024
Merged
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
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"]
Loading