-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (33 loc) · 1.08 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
ARG ARCH=armv7hf
ARG ACAP_SDK_VERSION=3.4.2
ARG SDK_IMAGE=axisecp/acap-sdk
ARG PTPD_VERSION=2.3.1
ARG STAGE_DIR=/stage
FROM $SDK_IMAGE:$ACAP_SDK_VERSION-$ARCH-ubuntu20.04 AS builder
ARG PTPD_VERSION
ARG SRC_DIR=/usr/local/src
ARG PTP_DIR=$SRC_DIR/ptpd-$PTPD_VERSION
ARG STAGE_DIR
# Get source code
WORKDIR $SRC_DIR
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -L http://downloads.sourceforge.net/project/ptpd/ptpd/$PTPD_VERSION/ptpd-$PTPD_VERSION.tar.gz | tar xz
WORKDIR $PTP_DIR
# Cross compile for our target
RUN . /opt/axis/acapsdk/environment-setup* && \
ac_cv_func_malloc_0_nonnull=yes ./configure --host=arm --with-pcap-config=pkg-config --disable-snmp && \
make -j install && \
$STRIP /usr/local/sbin/ptpd2
# Package ACAP
WORKDIR "$STAGE_DIR"
RUN cp /usr/local/sbin/ptpd2 . && \
cp $PTP_DIR/COPYRIGHT LICENSE && \
echo 'all:' > Makefile
COPY manifest.json \
ptpd2.conf \
./
RUN . /opt/axis/acapsdk/environment-setup* && \
acap-build -a ptpd2 -a ptpd2.conf .
FROM scratch
ARG STAGE_DIR
COPY --from=builder "$STAGE_DIR"/*eap "$STAGE_DIR"/*LICENSE.txt /