-
Notifications
You must be signed in to change notification settings - Fork 3
/
dockerfile_manually
49 lines (40 loc) · 1.53 KB
/
dockerfile_manually
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
ARG ROS_DISTRO
FROM public.ecr.aws/docker/library/ros:${ROS_DISTRO}-ros-core as base
FROM ghcr.io/ipa-rwu/builder:latest as builder
FROM base as deps
COPY . /root/ws/src
RUN cd /root/ws/src && \
rm /root/ws/src/dep.repo
COPY --from=builder workspace.bash /builder/workspace.bash
RUN apt-get update -qq && \
apt-get install -y git && \
cd /root/ws/src && \
git clone https://github.com/PLCnext/gRPC-client-deps.git -b ${ROS_DISTRO}/devel
RUN cd /root/ws/src/gRPC-client-deps/plcnext_deps/ && \
/root/ws/src/gRPC-client-deps/plcnext_deps/dep_copy.sh ${ROS_DISTRO} && \
rm -rf /var/lib/apt/lists/*
FROM deps as pre_build
RUN apt-get update -qq && \
/builder/workspace.bash update_list /root/ws && \
rm -rf /var/lib/apt/lists/*
FROM pre_build as build
ARG CMAKE_ARGS=
ENV CMAKE_ARGS -DCMAKE_BUILD_TYPE=RELEASE
RUN apt-get update -qq && \
/builder/workspace.bash build_workspace /root/ws && \
rm -rf /var/lib/apt/lists/*
FROM build as test
RUN apt-get update -qq && \
/builder/workspace.bash test_workspace /root/ws && \
rm -rf /var/lib/apt/lists/*
FROM test as install
RUN apt-get update -qq && \
/builder/workspace.bash install_workspace /root/ws && \
rm -rf /var/lib/apt/lists/*
FROM base as deploy
COPY --from=install /root/ws/DEPENDS /root/ws/DEPENDS
COPY --from=builder workspace.bash /builder/workspace.bash
RUN apt-get update -qq && \
/builder/workspace.bash install_depends /root/ws && \
rm -rf /var/lib/apt/lists/*
COPY --from=install /opt/ros/${ROS_DISTRO} /opt/ros/${ROS_DISTRO}