diff --git a/.devcontainer/Dockerfile.arm64 b/.devcontainer/Dockerfile.arm64 index 7f32e6e..dcbfb10 100644 --- a/.devcontainer/Dockerfile.arm64 +++ b/.devcontainer/Dockerfile.arm64 @@ -1,29 +1,33 @@ FROM arm64v8/ubuntu:22.04 -SHELL ["/bin/bash", "-c"] -RUN apt-get update --fix-missing &&\ - apt-get install -y --no-install-recommends build-essential ca-certificates cmake git g++ pkg-config python3 curl ninja-build tar zip unzip zlib1g-dev libssl-dev wget &&\ - apt-get autoclean &&\ - apt-get autoremove &&\ - apt-get clean &&\ - rm -rf /var/lib/apt/lists/* +RUN apt-get update --fix-missing \ + && apt-get install -y --no-install-recommends \ + build-essential \ + ca-certificates \ + cmake \ + git \ + libcli11-dev \ + libeigen3-dev \ + libgrpc++-dev \ + libprotobuf-dev \ + g++ \ + pkg-config \ + protobuf-compiler \ + protobuf-compiler-grpc \ + python3 \ + curl \ + ninja-build \ + tar \ + zip \ + unzip \ + zlib1g-dev \ + libssl-dev \ + wget \ + && apt-get autoclean \ + && apt-get autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* RUN update-ca-certificates -RUN wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3.tar.gz &&\ - tar -xzf cmake-3.28.3.tar.gz &&\ - cd cmake-3.28.3 &&\ - ./configure &&\ - make install &&\ - cd .. &&\ - rm cmake-3.28.3.tar.gz &&\ - rm -r cmake-3.28.3 - -RUN git clone https://github.com/microsoft/vcpkg &&\ - cd vcpkg &&\ - git checkout 3b213864579b6fa686e38715508f7cd41a50900f &&\ - export VCPKG_FORCE_SYSTEM_BINARIES=arm &&\ - ./bootstrap-vcpkg.sh -disableMetrics &&\ - ./vcpkg install grpc:arm64-linux &&\ - ./vcpkg install eigen3:arm64-linux &&\ - ./vcpkg install cli11:arm64-linux +COPY entrypoint.sh . diff --git a/.devcontainer/Dockerfile.arm64_vcpkg b/.devcontainer/Dockerfile.arm64_vcpkg new file mode 100644 index 0000000..7f32e6e --- /dev/null +++ b/.devcontainer/Dockerfile.arm64_vcpkg @@ -0,0 +1,29 @@ +FROM arm64v8/ubuntu:22.04 +SHELL ["/bin/bash", "-c"] + +RUN apt-get update --fix-missing &&\ + apt-get install -y --no-install-recommends build-essential ca-certificates cmake git g++ pkg-config python3 curl ninja-build tar zip unzip zlib1g-dev libssl-dev wget &&\ + apt-get autoclean &&\ + apt-get autoremove &&\ + apt-get clean &&\ + rm -rf /var/lib/apt/lists/* + +RUN update-ca-certificates + +RUN wget https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3.tar.gz &&\ + tar -xzf cmake-3.28.3.tar.gz &&\ + cd cmake-3.28.3 &&\ + ./configure &&\ + make install &&\ + cd .. &&\ + rm cmake-3.28.3.tar.gz &&\ + rm -r cmake-3.28.3 + +RUN git clone https://github.com/microsoft/vcpkg &&\ + cd vcpkg &&\ + git checkout 3b213864579b6fa686e38715508f7cd41a50900f &&\ + export VCPKG_FORCE_SYSTEM_BINARIES=arm &&\ + ./bootstrap-vcpkg.sh -disableMetrics &&\ + ./vcpkg install grpc:arm64-linux &&\ + ./vcpkg install eigen3:arm64-linux &&\ + ./vcpkg install cli11:arm64-linux diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh index 84264e9..69ee41b 100755 --- a/.devcontainer/build.sh +++ b/.devcontainer/build.sh @@ -1,2 +1,13 @@ #!/usr/bin/env bash +ARCH=$(dpkg --print-architecture) + +if [ "$ARCH" == "amd64" ]; then + docker build -t spot_builder -f Dockerfile.amd64 . +elif [ "$ARCH" == "arm64" ]; then + docker build -t spot_builder -f Dockerfile.arm64 . +else + echo "Unknown architecture: $ARCH" > /dev/stderr + exit 1 +fi + docker run -v ~/spot-cpp-sdk:/spot-cpp-sdk spot_builder /entrypoint.sh