This repository has been archived by the owner on Mar 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDockerfile.rlserver
94 lines (79 loc) · 3.33 KB
/
Dockerfile.rlserver
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
# (C) 2023 Volvo Cars
#
# All files and artifacts in the repository at https://github.com/w3c/automotive-vissv2
# are licensed under the provisions of the license provided by the LICENSE file in this repository.
# To run with redis as state storage use docker compose. This can be used to build individual images but will not
# run.
ARG GO_VERSION=1.18.3
ARG VSSTREE_NAME="vss_vissv2.binary"
ARG BUILD_IMAGE="golang:latest"
ARG RUNTIME_IMAGE="debian:bullseye-slim"
#----------------------Builder-----------------------
FROM ${BUILD_IMAGE} AS builder
ARG VSSTREE_NAME
WORKDIR /build
#add bin folder to store the compiled files
RUN mkdir bin
#corporate proxy settings can sometimes cause tls verification error. Add root crt to docker container.
COPY testCredGen/cicso-umbrella/cisco.crt /usr/local/share/ca-certificates/cisco.crt
RUN update-ca-certificates
#copy the content of the server and utils dir and .mod/.sum files to builder
COPY redis/redis.conf ./etc/
COPY client/ ./client
COPY feeder/ ./feeder
COPY server/ ./server
COPY grpc_pb/ ./grpc_pb
COPY protobuf/ ./protobuf
COPY utils ./utils
COPY go.mod go.sum ./
RUN ls -a etc/
#copy cert info from testCredGen to path expected by w3c server
COPY testCredGen/ca transport_sec/ca
COPY testCredGen/server transport_sec/server
COPY testCredGen/client transport_sec/client
#clean up unused dependencies
#RUN go mod tidy
#compile all projects and place the executables in the bin folder
RUN go build -v -o ./bin ./...
#----------------------runtime-----------------------
FROM ${RUNTIME_IMAGE} AS runtime
RUN apt-get update && apt-get upgrade -y
RUN apt-get update && apt-get install -y net-tools iproute2 iputils-ping
RUN apt-get autoclean -y
RUN apt-get autoremove -y
COPY --from=builder /build/transport_sec/ ../transport_sec/.
FROM redis
USER root
#RUN apt-get update && apt-get install -y redis-server
COPY --from=builder /build/etc/redis.conf /etc/.
EXPOSE 6379
ENTRYPOINT ["/usr/bin/redis-server", "/etc/redis.conf" ]
FROM golang:1.21-bookworm as feeder
USER root
WORKDIR /app
COPY --from=builder /build/bin/feeder-rl feeder
COPY --from=builder /build/feeder/feeder-rl/certificate.pem .
COPY --from=builder /build/feeder/feeder-rl/config.json .
COPY --from=builder /build/feeder/feeder-rl/VehicleVssMapData.json .
ENTRYPOINT ["/app/feeder"]
FROM golang:1.21-bookworm as vissv2server
USER root
RUN mkdir transport_sec
WORKDIR /app
RUN mkdir /app/atServer
COPY --from=builder /build/bin/vissv2server .
COPY --from=builder /build/server/transport_sec/transportSec.json ../transport_sec/transportSec.json
COPY --from=builder /build/server/vissv2server/atServer/purposelist.json atServer/purposelist.json
COPY --from=builder /build/server/vissv2server/atServer/scopelist.json atServer/scopelist.json
COPY --from=builder /build/server/vissv2server/uds-registration.docker.json uds-registration.json
COPY --from=builder /build/server/vissv2server/vss_vissv2.binary .
COPY --from=builder /build/server/agt_server/agt_public_key.rsa .
ENTRYPOINT ["/app/vissv2server","-s","redis"]
FROM golang:1.21-bookworm as agt_server
USER root
RUN mkdir transport_sec
WORKDIR /app
COPY --from=builder /build/bin/agt_server .
COPY --from=builder /build/server/transport_sec/transportSec.json ../transport_sec/transportSec.json
COPY --from=builder /build/server/agt_server/agt_public_key.rsa .
COPY --from=builder /build/server/agt_server/agt_private_key.rsa .