-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathDockerfile
71 lines (58 loc) · 2.28 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
ARG UBUNTU_VERSION=jammy-20230126
FROM ubuntu:$UBUNTU_VERSION AS dependencies
ENV DEBIAN_FRONTEND=noninteractive
ADD scripts/install_dependencies.sh /usr/local/bin/
RUN sed -i 's|http://archive.ubuntu.com|http://us.archive.ubuntu.com|g' /etc/apt/sources.list
RUN /usr/local/bin/install_dependencies.sh
# build out ext components
COPY ./ext /home/V2X-Hub/ext
WORKDIR /home/V2X-Hub/ext/
RUN ./build.sh
ADD container/wait-for-it.sh /usr/local/bin/
ADD container/service.sh /usr/local/bin/
COPY ./container /home/V2X-Hub/container
WORKDIR /home/V2X-Hub/container/
RUN ./database.sh
RUN ./library.sh
RUN ldconfig
# build internal components
COPY ./src /home/V2X-Hub/src/
WORKDIR /home/V2X-Hub/src/
RUN ./build.sh release
RUN ldconfig
# run final image
FROM ubuntu:$UBUNTU_VERSION AS v2xhub
ENV DEBIAN_FRONTEND=noninteractive
ADD scripts/deployment_dependencies.sh /usr/local/bin/
RUN /usr/local/bin/deployment_dependencies.sh
COPY ./container /home/V2X-Hub/container/
WORKDIR /home/V2X-Hub/container/
RUN ./database.sh
RUN ./library.sh
RUN ldconfig
COPY --from=dependencies /usr/local/plugins/ /usr/local/plugins/
COPY --from=dependencies /usr/local/include/ /usr/local/include/
COPY --from=dependencies /usr/local/lib/ /usr/local/lib/
COPY --from=dependencies /usr/local/bin/ /usr/local/bin/
COPY --from=dependencies /usr/lib/ /usr/lib/
COPY --from=dependencies /usr/bin/ /usr/bin/
COPY --from=dependencies /usr/local/share/ /usr/local/share/
COPY --from=dependencies /var/www/plugins/ /var/www/plugins/
COPY --from=dependencies /var/log/tmx/ /var/log/tmx/
COPY --from=dependencies /opt/ /opt/
ADD src/tmx/TmxCore/tmxcore.service /lib/systemd/system/
ADD src/tmx/TmxCore/tmxcore.service /usr/sbin/
RUN ldconfig
RUN /home/V2X-Hub/container/setup.sh
WORKDIR /var/log/tmx
# Set metadata labels
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.name="V2X-Hub-Deployment"
LABEL org.label-schema.description="Image V2X-Hub Deployment"
LABEL org.label-schema.vendor="Leidos"
LABEL org.label-schema.version="${VERSION}"
LABEL org.label-schema.url="https://highways.dot.gov/research/research-programs/operations"
LABEL org.label-schema.vcs-url="https://github.com/usdot-fhwa-ops/V2X-HUB"
LABEL org.label-schema.vcs-ref=${VCS_REF}
LABEL org.label-schema.build-date=${BUILD_DATE}
ENTRYPOINT ["/usr/local/bin/service.sh"]