加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
#########################################################################################
# Micro XRCE-DDS Agent Docker
#########################################################################################
# Build stage
FROM ubuntu AS build
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root
# Essentials
RUN apt-get update
RUN apt-get install -y \
software-properties-common \
build-essential \
cmake \
git
# Java
RUN apt install -y openjdk-8-jdk
ENV JAVA_HOME "/usr/lib/jvm/java-8-openjdk-amd64/"
# Gradle
RUN apt-get install -y gradle
RUN apt-get clean
# Prepare Micro XRCE-DDS Agent workspace
RUN mkdir -p /agent/build
ADD . /agent/
# Build Micro XRCE-DDS Agent and install
RUN cd /agent/build && \
cmake -DCMAKE_INSTALL_PREFIX=../install \
.. &&\
make -j $(nproc) && make install
# Prepare Micro XRCE-DDS Agent artifacts
RUN cd /agent && \
tar -czvf install.tar.gz -C install .
# Final user image
FROM ubuntu
WORKDIR /root
# Copy Micro XRCE-DDS Agent build artifacts
COPY --from=build /agent/install.tar.gz /usr/local/
RUN tar -xzvf /usr/local/install.tar.gz -C /usr/local/ &&\
rm /usr/local/install.tar.gz
COPY --from=build /agent/agent.refs .
RUN ldconfig
ENTRYPOINT ["MicroXRCEAgent"]
CMD ["--help"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化