Skip to content

Commit

Permalink
Containerfile: install MOTIS in separate stage, from official image
Browse files Browse the repository at this point in the history
to benefit from layer caching

related: patrickbr/gtfstidy#23
  • Loading branch information
derhuerst committed Feb 26, 2024
1 parent c98e80c commit dba1625
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ci/container/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ RUN apt-get update -y && \

RUN wget -qO - https://github.com/motis-project/motis/releases/download/${MOTIS_VERSION}/motis-linux-amd64.tar.bz2 | tar -C /opt/ -jx

FROM ghcr.io/gtfstidy/gtfstidy AS gtfstidy

FROM docker.io/debian:bookworm-slim

ARG USERNAME=transitous
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN apt-get update -y && \
apt-get install -y --no-install-recommends git python3-requests python3-jinja2 golang && \
apt-get install -y --no-install-recommends git python3-requests python3-jinja2 && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -29,7 +31,8 @@ RUN \
chown -R "$USER_UID:$USER_GID" /opt/motis
ENV PATH=/opt/motis:$PATH

RUN GOBIN=/usr/local/bin/ go install github.com/patrickbr/gtfstidy@latest
# install gtfstidy from `gtfstidy` stage
COPY --from=gtfstidy /usr/local/bin/gtfstidy /usr/local/bin/gtfstidy

# Create the user / set user rights
RUN groupadd --gid $USER_GID $USERNAME && \
Expand Down

0 comments on commit dba1625

Please sign in to comment.