-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.aarch64
64 lines (53 loc) · 2.86 KB
/
Dockerfile.aarch64
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
# Repository and tag variables
ARG ARCH=aarch64
ARG API_VERSION=3.5
ARG TOOLCHAIN_VERSION=3.5
ARG TOOLCHAINS_UBUNTU_VERSION=20.04
ARG SDK_UBUNTU_VERSION=22.04
ARG REPO=axisecp
FROM ${REPO}/acap-api:${API_VERSION}-${ARCH}-ubuntu${TOOLCHAINS_UBUNTU_VERSION} as api
FROM ${REPO}/acap-toolchain:${TOOLCHAIN_VERSION}-${ARCH}-ubuntu${TOOLCHAINS_UBUNTU_VERSION} as toolchain
FROM ubuntu:${SDK_UBUNTU_VERSION}
# Install packages needed for interactive users and some additional libraries
# - curl, iputils-ping: required by eap-install.sh
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
crossbuild-essential-arm64 \
make \
pkg-config \
python3-pip \
python3-jsonschema \
curl \
iputils-ping \
xz-utils \
git \
less \
vim
# Add symlink for python
RUN cd /usr/bin && ln -s python3 python
# Copy and install the tools and scripts from toolchain container
COPY --from=toolchain /opt/axis/sdk/temp /opt/axis/acapsdk
COPY --from=toolchain /opt/axis/tools /opt/axis/tools
RUN apt-get install -y /opt/axis/tools/axis-acap-manifest-tools*.deb && \
rm -rf /opt/axis/tools
# Install protobuf code compiler of same version as target protobuf libraries
ARG AXPROTOC=3.13.0
RUN curl --fail -L https://repo1.maven.org/maven2/com/google/protobuf/protoc/${AXPROTOC}/protoc-${AXPROTOC}-linux-x86_64.exe -o /usr/bin/protoc && chmod +x /usr/bin/protoc
# Add axis-acap-manifest-tools to PATH
RUN sed -i 's#export PATH=#export PATH=/opt/axis/acapsdk/axis-acap-manifest-tools/manifest-generator:#g' /opt/axis/acapsdk/environment-setup*
# Update paths and add explicit sdk path to linker in environment-setup script
# Add the --disable-new-dtags parameter to the default LDFLAGS to solve dynamic library rpath issues
RUN sed -i 's:/opt/axis/sdk:/opt/axis/acapsdk:g' /opt/axis/acapsdk/environment-setup* && \
sed -i '/\(CC\|CPP\|CXX\)=/s:"$: -L$SDKTARGETSYSROOT/usr/lib":g' /opt/axis/acapsdk/environment-setup* && \
sed -i '/^export LDFLAGS=/ s:"$: -Wl,--disable-new-dtags":' /opt/axis/acapsdk/environment-setup*
# Copy the lib, include, .pc and Axis protobuf files from the API container
ARG ARCH=aarch64
COPY --from=api /opt/axis/sdk/temp/sysroots/${ARCH}/usr/lib/ /opt/axis/acapsdk/sysroots/${ARCH}/usr/lib/
COPY --from=api /opt/axis/sdk/temp/sysroots/${ARCH}/usr/include/ /opt/axis/acapsdk/sysroots/${ARCH}/usr/include/
COPY --from=api /opt/axis/sdk/temp/sysroots/${ARCH}/usr/share/protobuf/ /opt/axis/acapsdk/sysroots/${ARCH}/usr/share/protobuf/
# Add a missing file for OpenGL
ARG KHR_DIR=/opt/axis/acapsdk/sysroots/${ARCH}/usr/include/KHR
RUN curl --create-dirs -o ${KHR_DIR}/khrplatform.h https://raw.githubusercontent.com/KhronosGroup/EGL-Registry/master/api/KHR/khrplatform.h
# Make the environment sourced for interactive Bash users
RUN printf "\n# Source SDK for all users\n. /opt/axis/acapsdk/environment-*\n" >> /etc/bash.bashrc
# Set workdir
WORKDIR /opt/app