-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
115 lines (97 loc) · 3.98 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# We are interested in the binaries compiled on that container:
FROM ghcr.io/etalab/transport-tools:v1.0.7 AS transport-tools
# We leverage the base images published by hexpm at:
#
# https://hub.docker.com/r/hexpm/elixir
#
# Which are built via:
#
# https://github.com/hexpm/bob#docker-images
#
# They provide the ability to decouple Elixir version
# and OTP version, which is a nice feature for
# incremental/decoupled upgrades.
#
# These base images package Elixir and OTP releases found at:
# - https://github.com/elixir-lang/elixir/releases
# - https://github.com/erlang/otp/releases
#
#
# So again, to upgrade this, check out :
#
# https://hub.docker.com/r/hexpm/elixir
FROM hexpm/elixir:1.17.3-erlang-27.1-ubuntu-focal-20240530
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
RUN apt-get update && apt-get install -y \
curl \
wget \
libtool \
git \
tzdata \
zip \
default-jre \
maven
# AppSignal dependencies https://docs.appsignal.com/support/operating-systems.html#debian-ubuntu
# without them the appsignal Elixir package installation will log an error but not stop the build!
RUN apt-get update && apt-get install -y build-essential ca-certificates
# Helps bump the output of /etc/os-release from says "Ubuntu 24.04.2 LTS" to "... 24.04.3"
#
# The source image (hex) is itself based on a ubuntu image whose
# packages are not necessarily up-to-date all the time. We want to
# upgrade and ensure we are as up-to-date as possible.
# Note that the kernel itself cannot be upgraded here apparently
# (https://stackoverflow.com/a/66413248)
#
# See https://github.com/etalab/transport_deploy/issues/46 for more context
RUN apt-get upgrade -y
# debugging information
RUN uname --all
RUN cat /etc/os-release
RUN cat /etc/lsb-release
# Helps bump the output of /etc/os-release from says "Ubuntu 24.04.2 LTS" to "... 24.04.3"
#
# The source image (hex) is itself based on a ubuntu image whose
# packages are not necessarily up-to-date all the time. We want to
# upgrade and ensure we are as up-to-date as possible.
# Note that the kernel itself cannot be upgraded here apparently
# (https://stackoverflow.com/a/66413248)
#
# See https://github.com/etalab/transport_deploy/issues/46 for more context
RUN apt-get upgrade -y
# debugging information
RUN uname --all
RUN cat /etc/os-release
RUN cat /etc/lsb-release
ENV NVM_VERSION=v0.40.1
ENV NODE_VERSION=20.17.0
ENV NVM_DIR=$HOME/.nvm
RUN mkdir $NVM_DIR
# Install NVM
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/${NVM_VERSION}/install.sh | bash
# Install NODE ("." is the sh equivalent to the bash "source" command)
RUN . $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use --delete-prefix $NODE_VERSION
# add to path
ENV NODE_PATH=$NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
RUN npm install -g yarn
# Install app dependencies
RUN mix local.hex --force
RUN mix local.rebar --force
RUN mkdir /transport-tools
COPY --from=transport-tools /usr/local/bin/gtfs-geojson ./transport-tools
RUN chmod +x /transport-tools/gtfs-geojson
# quick check to verify binary dependencies are matched
RUN /transport-tools/gtfs-geojson --help
COPY --from=transport-tools /usr/local/bin/gtfs2netexfr ./transport-tools
# hackish - see https://github.com/etalab/transport-tools/blob/master/Dockerfile#L56
RUN apt-get update
RUN apt-get -y install libtiff5 libcurl3-nss
COPY --from=transport-tools /usr/lib/libproj.* /usr/lib/
RUN mkdir /usr/share/proj/
COPY --from=transport-tools /usr/share/proj/ /usr/share/proj/
RUN /transport-tools/gtfs2netexfr --help
COPY --from=transport-tools /usr/local/bin/gtfs-realtime-validator-lib-1.0.0-SNAPSHOT.jar ./transport-tools
RUN java -jar /transport-tools/gtfs-realtime-validator-lib-1.0.0-SNAPSHOT.jar 2>&1 | grep "For batch mode you must provide a path and file name to GTFS data"
COPY --from=transport-tools /usr/local/bin/gtfs-validator-3.1.1-cli.jar ./transport-tools
RUN java -jar /transport-tools/gtfs-validator-3.1.1-cli.jar --help | grep "Location of the input GTFS ZIP"