-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (40 loc) · 1.24 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
# parameters
ARG REPO_NAME="dt-core"
# ==================================================>
# ==> 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
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}/"
# 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="<YOUR_FULL_NAME> (<YOUR_EMAIL_ADDRESS>)"