forked from eclipse-kuksa/kuksa-incubation
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
67 lines (50 loc) · 2.81 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
# /********************************************************************************
# * Copyright (c) 2022 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License 2.0 which is available at
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/
# DO NOT UPDATE ubuntu version, it must match the image used for building seat_service/bin_vservice-seat_*_release.*
FROM --platform=$BUILDPLATFORM ubuntu:latest as builder
ARG TARGETPLATFORM
WORKDIR /workspace
COPY bin_vservice-seat_*_release.* /workspace
# FIXME! Binaries are built from another base image, potentially incompatible with ubuntu:latest image
# RUN tar -xf bin_vservice-seat_x86_64_release.tar.gz && tar -xf bin_vservice-seat_aarch64_release.tar.gz
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ] ; \
then tar -xf bin_vservice-seat_x86_64_release.tar.gz && cp -rv ./target/x86_64/release/install/ ./bins; \
else tar -xf bin_vservice-seat_aarch64_release.tar.gz && cp -rv ./target/aarch64/release/install/ ./bins; fi
FROM --platform=$TARGETPLATFORM ubuntu:latest as runtime
LABEL org.opencontainers.image.description "VAL Seat Service container, providing VSC Seat impl and supporting simulated/real can ECU"
## Uncomment for ip/can tools
#RUN apt-get -qqy update && apt-get install -qqy net-tools can-utils iproute2 && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends can-utils && apt-get clean && rm -rf /var/lib/apt/lists/*
# make sure localhost can be resolved!
RUN cat /etc/hosts | grep -q localhost || echo "127.0.0.1 localhost" >> /etc/hosts
COPY --from=builder workspace/bins /app
WORKDIR /app/bin
### "cansim" is special value for using SeatAdjuster CAN simulator (even without vcan support in container)
ENV CAN=cansim
### if set to 1, forces running ecu-reset script on startup that does not work with cansim and also delays 3s the startup of can stup without actual Seat ECU
# ENV SC_RESET=0
### [vxcan] options
# By default, wait for can-forward.sh to move vxcan1 in container's namespace after container start
#ENV CAN=vxcan1
# If set, val_start.sh shall wait up to specified time (sec) for can interface to appear in the container.
#ENV CAN_WAIT=30
# SeatService VSS support [3, 4]
ENV VSS=4
# Seat Service GRPC bind host
ENV SERVICE_HOST=0.0.0.0
# SeatService GRPC bind port
ENV SERVICE_PORT=50051
EXPOSE 50051
# Override this variable to change DataBroker address. Port can be also overridden by DAPR_GRPC_PORT variable.
ENV BROKER_ADDR=127.0.0.1:55555
CMD [ "./val_start.sh" ]