Skip to content

Commit 693d7f2

Browse files
committed
add sdk build step
1 parent a337954 commit 693d7f2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

etc/docker/Dockerfile.sdk-build

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This Dockerfile is meant to be built on top of an existing image from the base-images directory.
2+
# Suggested usage, from the SDK root:
3+
# docker build -t base/bullseye -f etc/docker/base-images/Dockerfile.debian.bullseye .
4+
# docker build --build-arg BASE_TAG=base/bullseye --build-arg GIT_TAG=[...] etc/docker/Dockerfile.sdk-build .
5+
# You can substitute the bullseye image for whichever you want to use as a base.
6+
# Note that it is necessary to tag the base image with `-t` and then refer to it using the `BASE_TAG` arg.
7+
ARG BASE_TAG
8+
FROM ${BASE_TAG} AS build-sdk
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
11+
ARG GIT_TAG
12+
ARG BUILD_TYPE=RelWithDebInfo
13+
ARG BUILD_SHARED=ON
14+
ARG BUILD_TESTS=OFF
15+
ARG BUILD_EXAMPLES=OFF
16+
17+
RUN git clone https://github.com/viamrobotics/viam-cpp-sdk/ -b ${GIT_TAG}
18+
19+
WORKDIR /viam-cpp-sdk
20+
21+
RUN mkdir build && \
22+
cd build && \
23+
cmake .. -G Ninja \
24+
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
25+
-DBUILD_SHARED_LIBS=${BUILD_SHARED} \
26+
-DVIAMCPPSDK_OFFLINE_PROTO_GENERATION=ON \
27+
-DVIAMCPPSDK_BUILD_TESTS=${BUILD_TESTS} \
28+
-DVIAMCPPSDK_BUILD_EXAMPLES=${BUILD_EXAMPLES}
29+
30+
RUN cmake --build build --target install && \
31+
cmake --install build
32+

0 commit comments

Comments
 (0)