-
Notifications
You must be signed in to change notification settings - Fork 59
/
Dockerfile
66 lines (52 loc) · 1.7 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
#
# Copyright (c) 2022 ZettaScale Technology
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# ZettaScale Zenoh Team, <[email protected]>
#
###
### Build part
###
FROM rust:slim-buster as builder
WORKDIR /usr/src/zenoh-plugin-dds
# List of installed tools:
# * for CycloneDDS
# - g++
# - cmake
# * for zenoh-dds-plugin
# - git
# - clang
RUN apt-get update && apt-get -y install g++ git clang wget tar build-essential
RUN wget https://github.com/Kitware/CMake/releases/download/v3.24.2/cmake-3.24.2-linux-x86_64.tar.gz \
-q -O /tmp/cmake-install.tar.gz \
&& tar xzf /tmp/cmake-install.tar.gz \
&& cp -r cmake-3.24.2-linux-x86_64/* /usr/ \
&& rm /tmp/cmake-install.tar.gz
RUN cmake --version
COPY . .
# if exists, copy .git directory to be used by git-version crate to determine the version
COPY .gi? .git/
RUN cargo install --locked --path zenoh-bridge-dds
###
### Run part
###
FROM debian:buster-slim
RUN apt-get update && apt-get install -y libssl1.1 && rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/cargo/bin/zenoh-bridge-dds /usr/local/bin/zenoh-bridge-dds
RUN ldconfig -v
RUN echo '#!/bin/bash' > /entrypoint.sh
RUN echo 'echo " * Starting: zenoh-bridge-dds $*"' >> /entrypoint.sh
RUN echo 'exec zenoh-bridge-dds $*' >> /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 7446/udp
EXPOSE 7447/tcp
EXPOSE 8000/tcp
ENV RUST_LOG info
ENTRYPOINT ["/entrypoint.sh"]