From 1392332ffee7474f1e5ad1707b8ce8538dcdf329 Mon Sep 17 00:00:00 2001 From: seanavery Date: Wed, 6 Dec 2023 15:24:24 -0500 Subject: [PATCH] Add l4t base dockerfile --- etc/Dockerfile.base.l4t | 111 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 etc/Dockerfile.base.l4t diff --git a/etc/Dockerfile.base.l4t b/etc/Dockerfile.base.l4t new file mode 100644 index 0000000..03a9ca7 --- /dev/null +++ b/etc/Dockerfile.base.l4t @@ -0,0 +1,111 @@ +ARG L4T_TAG +FROM nvcr.io/nvidia/l4t-base:${L4T_TAG} + +RUN apt-get -y update + +# install viam-cpp-sdk +# reference: https://github.com/viamrobotics/viam-cpp-sdk +RUN apt-get -y --no-install-recommends install \ + build-essential \ + ca-certificates \ + curl \ + doxygen \ + g++ \ + gdb \ + git \ + gnupg \ + gpg \ + less \ + libboost-all-dev \ + libc-ares-dev \ + libre2-dev \ + libssl-dev \ + ninja-build \ + pkg-config \ + software-properties-common \ + sudo \ + wget \ + zlib1g-dev + +RUN bash -c 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add -' +RUN apt-add-repository -y 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main' + +RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - > /usr/share/keyrings/kitware-archive-keyring.gpg +RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' > /etc/apt/sources.list.d/kitware.list + +RUN apt-get update + +RUN apt-get -y --no-install-recommends install -t llvm-toolchain-focal-15 \ + clang-15 \ + clang-tidy-15 + +RUN apt-get -y install cmake + +RUN mkdir -p ${HOME}/opt/src + +RUN cd ${HOME}/opt/src && \ + git clone --recurse-submodules -b v1.52.0 --depth 1 --shallow-submodules https://github.com/grpc/grpc && \ + cd grpc && \ + mkdir -p build && \ + cd build && \ + cmake .. -G Ninja \ + -DgRPC_ZLIB_PROVIDER=package \ + -DgRPC_CARES_PROVIDER=package \ + -DgRPC_RE2_PROVIDER=package \ + -DgRPC_SSL_PROVIDER=package \ + -DgRPC_INSTALL=ON \ + -DgRPC_BUILD_TESTS=OFF \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX=/usr/local \ + -DCMAKE_INSTALL_RPATH=/usr/local/lib && \ + ninja install && \ + cd .. && \ + rm -rf build + +RUN cd ${HOME}/opt/src && \ + git clone https://github.com/viamrobotics/viam-cpp-sdk && \ + cd viam-cpp-sdk && \ + mkdir build && \ + cd build && \ + cmake -DVIAMCPPSDK_USE_DYNAMIC_PROTOS=ON -DVIAMCPPSDK_OFFLINE_PROTO_GENERATION=ON .. -G Ninja && \ + ninja install -j 1 + +# install viam-csi +RUN cp -r ${HOME}/opt/src/viam-cpp-sdk/build/install/* /usr/local/ + +# install appimage-builder +RUN apt install -y \ + binutils \ + coreutils \ + desktop-file-utils \ + fakeroot \ + fuse \ + libgdk-pixbuf2.0-dev \ + patchelf \ + python3-pip python3-setuptools \ + squashfs-tools \ + strace \ + util-linux zsync + +RUN pip3 install -U pip setuptools urllib3==1.26.12 requests==2.26.0 + +# install appimage-builder +RUN cd ${HOME}/opt/src && \ + git clone https://github.com/AppImageCrafters/appimage-builder.git && \ + cd appimage-builder && \ + pip3 install ./ + +# install docker +RUN apt-get -y install \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg \ + lsb-release && \ + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \ + echo \ + "deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \ + apt-get -y update && \ + apt-get -y install docker-ce docker-ce-cli containerd.io \ No newline at end of file