forked from OSLL/template-ros-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (43 loc) · 1.37 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
# parameters
ARG REPO_NAME="demo_repo"
# ==================================================>
# ==> Do not change this code
ARG ARCH=arm32v7
ARG MAJOR=daffy
ARG BASE_TAG=${MAJOR}-${ARCH}
ARG BASE_IMAGE=dt-core
# define base image
FROM duckietown/${BASE_IMAGE}:${BASE_TAG}
# define repository path
ARG REPO_NAME
ARG REPO_PATH="${CATKIN_WS_DIR}/src/${REPO_NAME}"
WORKDIR "${REPO_PATH}"
# create repo directory
RUN mkdir -p "${REPO_PATH}"
# copy dependencies files only
RUN ls -la
COPY ./dependencies-apt.txt "${REPO_PATH}/"
COPY ./dependencies-py.txt "${REPO_PATH}/"
# install apt dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
$(awk -F: '/^[^#]/ { print $1 }' dependencies-apt.txt | uniq) \
&& rm -rf /var/lib/apt/lists/*
# install python dependencies
RUN pip install -r ${REPO_PATH}/dependencies-py.txt
# copy the source code
COPY . "${REPO_PATH}/"
RUN cp -r "${REPO_PATH}/packages/dt-core" "${CATKIN_WS_DIR}/src/"
RUN rm -r "${REPO_PATH}/packages/dt-core"
# build packages
RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \
catkin build \
--workspace ${CATKIN_WS_DIR}/
# define launch script
ENV LAUNCHFILE "${REPO_PATH}/launch.sh"
# define command
CMD ["bash", "-c", "${LAUNCHFILE}"]
# <== Do not change this code
# <==================================================
# maintainer
LABEL maintainer="Konstantin Chaika ([email protected])"