-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.aarch64
195 lines (180 loc) · 4.71 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# Repository and tag variables
ARG ARCH=aarch64
ARG API_VERSION=4.15_rc1
ARG TOOLCHAIN_VERSION=4.15_rc1
ARG TOOLCHAINS_UBUNTU_VERSION=22.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 \
jq \
bash-completion \
tree \
nano \
vim \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# 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
# 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 and .pc 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
# Remove legacy directories in SDKPATH/usr/lib
WORKDIR /opt/axis/acapsdk/sysroots/${ARCH}/usr/lib
RUN rm -rf \
*.d \
apr-util* \
*-poky-linux* \
conf-migrate \
dbus-* \
gdk-pixbuf-* \
icu \
legacyconfig \
modules \
opkg \
python3* \
rcscripts \
service_registry \
systemd \
udev
# Remove legacy files and symlinks in SDKPATH/usr/lib
RUN rm -f \
*-poky-linux* \
apr* \
libapac* \
libapr* \
libax_daemon* \
libaxaudio* \
libaxhttp* \
libaxptz* \
libboost_* \
libcapture* \
libgcrypt* \
libgmp* \
libgnutls* \
libgpg-error* \
libhogweed* \
libicu* \
libjpeg* \
liblzma* \
libmagic* \
libmenu* \
libmicrohttpd* \
libmount* \
libnet_http* \
libnettle* \
libpango* \
libparam* \
libprotobuf* \
libprotoc* \
libptzaurus* \
libptzmath* \
libpython* \
libscene* \
libsdbusplus* \
libservice_registry* \
libsmartcols* \
libsqlite* \
libti* \
libturbojpeg* \
libubsan* \
libudev* \
libuser_manager* \
libyuv* \
os-release
# Remove legacy files and symlinks in SDKPATH/usr/lib/pkgconfig
WORKDIR /opt/axis/acapsdk/sysroots/${ARCH}/usr/lib/pkgconfig
RUN rm -rf \
apr* \
axaudio.pc \
axhttp.pc \
axptz.pc \
dbus-* \
gdk-pixbuf-* \
gmp.pc \
gmpxx.pc \
gnutls.pc \
gpg-error.pc \
hogweed.pc \
icu* \
libgcrypt.pc \
libmagic.pc \
libmicrohttpd.pc \
libprotobuf-c.pc \
libscene.pc \
libuser_manager.pc \
nettle.pc \
pango* \
protobuf* \
python* \
sdbusplus.pc \
service_registry.pc \
video-service
# Remove legacy directories and files in SDKPATH/usr/include
WORKDIR /opt/axis/acapsdk/sysroots/${ARCH}/usr/include
RUN rm -rf \
apr* \
ax_daemon.h \
axis \
axsdk/axaudio* \
axsdk/axhttp* \
axsdk/axptz* \
capture* \
dbus-* \
gcrypt.h \
gmock \
gmp-32.h \
gmp.h \
gmpxx.h \
gnutls \
google \
gpg-error* \
gpgrt* \
gtest \
libyuv* \
magic.h \
microhttpd.h \
nettle \
pango-* \
protobuf-c \
ptz* \
python3* \
sdbusplus \
service_registry.h \
video-service
# 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