forked from eclipse/kuksa.val
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-cli
58 lines (46 loc) · 2.22 KB
/
Dockerfile-cli
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
# /********************************************************************************
# * Copyright (c) 2022, 2023 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
# ********************************************************************************/
# This is expected to be executed in the kuksa.val top-level directory
# You need to run build-all-targets-cli.sh first, as this docker file jsut
# collects the artifacts
# AMD is a statically linked MUSL build
FROM scratch AS target-amd64
ENV BUILDTARGET="x86_64-unknown-linux-musl"
COPY ./target/x86_64-unknown-linux-musl/release/databroker-cli /app/databroker-cli
# ARM64 is a statically linked GRPC build
FROM scratch AS target-arm64
ENV BUILDTARGET="aarch64-unknown-linux-musl"
COPY ./target/aarch64-unknown-linux-musl/release/databroker-cli /app/databroker-cli
# RISCV is a glibc build. Rust toolchain not supported for MUSL
# Normally we prefer "distroless" base images, i.e.:
# FROM gcr.io/distroless/base-debian12:debug as target-riscv64
# However, distorless has no RISCV support yet,
# (Nov 2023). Using debian unstable for now
FROM riscv64/debian:sid-slim as target-riscv64
ENV BUILDTARGET="riscv64gc-unknown-linux-gnu"
COPY ./target/riscv64gc-unknown-linux-gnu/release/databroker-cli /app/databroker-cli
# Databroker-cli is an interactive cli, thus it can only work correctly
# if we have some terminfo configurations available. We will transplant
# them from a donor
# While writing this, the latest versuion 3.18 does not support riscv yet,
# but edge does. As we are only getting some config files, this will
# likely not break
FROM alpine:edge as terminfo-donor
RUN apk update && apk add ncurses-terminfo-base
# Now adding generic parts
FROM target-$TARGETARCH as target
ARG TARGETARCH
COPY ./dist/$TARGETARCH/thirdparty/ /app/thirdparty
# Copy terminfo database
COPY --from=terminfo-donor /etc/terminfo /etc/terminfo
ENTRYPOINT [ "/app/databroker-cli" ]