Skip to content

Commit

Permalink
build(docker): Remove the go dependency by building yq from source (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelsJP authored Nov 29, 2024
2 parents c3b9d47 + 95b7903 commit 6274614
Showing 1 changed file with 7 additions and 1 deletion.
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/[email protected]

# 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

0 comments on commit 6274614

Please sign in to comment.