-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
51 lines (45 loc) · 1.39 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
ARG ARCH=aarch64
ARG ACAP_SDK_VERSION=1.15
ARG SDK_IMAGE=axisecp/acap-native-sdk
ARG BUILD_DIR=/usr/local/src
ARG ACAP_BUILD_DIR="$BUILD_DIR"/server-acap
ARG OPEN62541_VERSION=1.4.4
FROM $SDK_IMAGE:$ACAP_SDK_VERSION-$ARCH AS builder
ARG BUILD_DIR
ARG ACAP_BUILD_DIR
ARG OPEN62541_VERSION
ENV DEBIAN_FRONTEND=noninteractive
# Install additional build dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
cmake
# open62541
ARG OPEN62541_DIR="$BUILD_DIR"/open62541
ARG OPEN62541_SRC_DIR="$OPEN62541_DIR"/open62541-$OPEN62541_VERSION
ARG OPEN62541_BUILD_DIR="$OPEN62541_DIR"/build
WORKDIR "$OPEN62541_DIR"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl -L https://github.com/open62541/open62541/archive/refs/tags/v$OPEN62541_VERSION.tar.gz | tar xz
WORKDIR "$OPEN62541_BUILD_DIR"
RUN . /opt/axis/acapsdk/environment-setup* && \
cmake \
-DCMAKE_INSTALL_PREFIX="$SDKTARGETSYSROOT"/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_BUILD_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DUA_ENABLE_NODEMANAGEMENT=ON \
"$OPEN62541_SRC_DIR"
RUN make -j "$(nproc)" install
# ACAP application
WORKDIR "$ACAP_BUILD_DIR"
COPY LICENSE \
Makefile \
*.c \
*.h \
manifest.json \
./
RUN . /opt/axis/acapsdk/environment-setup* && \
acap-build .
FROM scratch
ARG ACAP_BUILD_DIR
COPY --from=builder "$ACAP_BUILD_DIR"/*eap "$ACAP_BUILD_DIR"/*LICENSE.txt /