-
I want to have an ACAP SDK image with a specific package, do I need to build my own SDK using the Dockerfiles in https://github.com/AxisCommunications/acap-native-sdk and installing the packages I want? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
No, it's enough to create a Example based on ACAP SDK image that installs build toolsAn example is openssl_curl_example where build tools like In the example Dockerfile we can see that it's based on an official ACAP SDK image, using ARG ARCH=armv7hf
ARG VERSION=1.2
ARG UBUNTU_VERSION=20.04
ARG REPO=axisecp
ARG SDK=acap-native-sdk
FROM ${REPO}/${SDK}:${VERSION}-${ARCH}-ubuntu${UBUNTU_VERSION} as sdk Then additional build tools (required to build OpenSSL and curl libraries) are installed to the SDK container with RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
autoconf \
libtool \
automake && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* OpenSSL source code (to be cross-compiled and used in an ACAP application running on an Axis device) is retrieved with Ubuntu command-line RUN curl -O https://www.openssl.org/source/openssl-${OPENSSL_VER}.tar.gz && \
tar xzvf openssl-${OPENSSL_VER}.tar.gz The curl source code repo on GitHub (to be cross-compiled and used in an ACAP application running on an Axis device) is cloned with RUN git clone https://github.com/curl/curl.git --branch=curl-${CURL_VER} curl-${CURL_VER} Then some intermediate steps are copying the libraries to the correct places to be used in the ACAP application build. The final step is then building the ACAP application. RUN . /opt/axis/acapsdk/environment-setup* && \
acap-build . -a ${PEM_CERT_FILE} Development loopWhen you build the application image according to the example build instructions docker build -t openssl_curl_example:armv7hf . you will use Docker build cache. This way the OpenSSL and curl libraries will be built on the first run and in the second the cache will be used, i.e. no rebuild of the libraries. The Docker build cache will however notice if your application source code files that are added with COPY ./app . have changed and the steps after, including the ACAP application build command will be rerun. |
Beta Was this translation helpful? Give feedback.
No, it's enough to create a
Dockerfile
for your application that is based on a public ACAP SDK image and install the packages you want.Example based on ACAP SDK image that installs build tools
An example is openssl_curl_example where build tools like
automake
andautoconf
are installed to build OpenSSL and curl libraries which are then used in the ACAP application.In the example Dockerfile we can see that it's based on an official ACAP SDK image, using
FROM
Then additional build tools (required to build OpenSSL and curl…