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

build(docker): Remove the go dependency by building yq from source #1916

Merged
merged 1 commit into from
Nov 29, 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
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ COPY ors-engine /tmp/ors/ors-engine
RUN mvn -pl '!ors-test-scenarios,!ors-report-aggregation' \
-q clean package -DskipTests -Dmaven.test.skip=true

FROM docker.io/maven:3.9.9-amazoncorretto-21-alpine AS build-go
# Setup the target system with the right user and folders.
RUN apk add --no-cache go && \
GO111MODULE=on go install github.com/mikefarah/yq/v4@v4.44.5

# build final image, just copying stuff inside
FROM docker.io/amazoncorretto:21.0.4-alpine3.20 AS publish

Expand All @@ -36,7 +41,7 @@ ARG ORS_HOME=/home/ors
ENV LANG='en_US' LANGUAGE='en_US' LC_ALL='en_US'

# Setup the target system with the right user and folders.
RUN apk update && apk add --no-cache bash=~5 jq=~1 openssl=~3 yq=~4 && \
RUN apk update && apk add --no-cache bash=~5 jq=~1 openssl=~3 && \
addgroup ors -g ${GID} && \
mkdir -p ${ORS_HOME}/logs ${ORS_HOME}/files ${ORS_HOME}/graphs ${ORS_HOME}/elevation_cache && \
adduser -D -h ${ORS_HOME} -u ${UID} --system -G ors ors && \
Expand All @@ -48,6 +53,7 @@ RUN apk update && apk add --no-cache bash=~5 jq=~1 openssl=~3 yq=~4 && \
COPY --chown=ors:ors --from=build /tmp/ors/ors-api/target/ors.jar /ors.jar
COPY --chown=ors:ors ./$OSM_FILE /heidelberg.test.pbf
COPY --chown=ors:ors ./docker-entrypoint.sh /entrypoint.sh
COPY --chown=ors:ors --from=build-go /root/go/bin/yq /bin/yq

# Copy the example config files to the build folder
COPY --chown=ors:ors ./ors-config.yml /example-ors-config.yml
Expand Down
Loading