forked from surirohit/template-ros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
64 lines (51 loc) · 1.63 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
# parameters
ARG REPO_NAME="<REPO_NAME_HERE>"
# ==================================================>
# ==> Do not change this code
ARG ARCH=arm32v7
ARG MAJOR=daffy
ARG BASE_TAG=${MAJOR}-${ARCH}
ARG BASE_IMAGE=dt-ros-commons
# 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}"
# install apt dependencies
COPY ./dependencies-apt.txt "${REPO_PATH}/"
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
COPY ./dependencies-py.txt "${REPO_PATH}/"
RUN pip install -r ${REPO_PATH}/dependencies-py.txt
# copy the source code
COPY . "${REPO_PATH}/"
# 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}"]
# store module name
LABEL org.duckietown.label.module.type "${REPO_NAME}"
ENV DT_MODULE_TYPE "${REPO_NAME}"
# store module metadata
ARG ARCH
ARG MAJOR
ARG BASE_TAG
ARG BASE_IMAGE
LABEL org.duckietown.label.architecture "${ARCH}"
LABEL org.duckietown.label.code.location "${REPO_PATH}"
LABEL org.duckietown.label.code.version.major "${MAJOR}"
LABEL org.duckietown.label.base.image "${BASE_IMAGE}:${BASE_TAG}"
# <== Do not change this code
# <==================================================
# maintainer
LABEL maintainer="<YOUR_FULL_NAME> (<YOUR_EMAIL_ADDRESS>)"