From f99950bedfb1c3e2fa9b661f8f8a0fcf2021cf79 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 2 Feb 2024 23:10:55 -0500 Subject: [PATCH] build(docker): add docker toolchain for clion --- docker/clion-toolchain.dockerfile | 102 ++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 docker/clion-toolchain.dockerfile diff --git a/docker/clion-toolchain.dockerfile b/docker/clion-toolchain.dockerfile new file mode 100644 index 00000000000..10d7e123828 --- /dev/null +++ b/docker/clion-toolchain.dockerfile @@ -0,0 +1,102 @@ +# syntax=docker/dockerfile:1.4 +# artifacts: false +# platforms: linux/amd64 +# platforms_pr: linux/amd64 +# no-cache-filters: toolchain-base,toolchain +ARG BASE=ubuntu +ARG TAG=22.04 +FROM ${BASE}:${TAG} AS toolchain-base + +ENV DEBIAN_FRONTEND=noninteractive + +FROM toolchain-base as toolchain + +ARG TARGETPLATFORM +RUN echo "target_platform: ${TARGETPLATFORM}" + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +# install dependencies +RUN <<_DEPS +#!/bin/bash +set -e +apt-get update -y +apt-get install -y --no-install-recommends \ + build-essential \ + cmake=3.22.* \ + ca-certificates \ + gcc=4:11.2.* \ + g++=4:11.2.* \ + gdb \ + git \ + libayatana-appindicator3-dev \ + libavdevice-dev \ + libboost-filesystem-dev=1.74.* \ + libboost-locale-dev=1.74.* \ + libboost-log-dev=1.74.* \ + libboost-program-options-dev=1.74.* \ + libcap-dev \ + libcurl4-openssl-dev \ + libdrm-dev \ + libevdev-dev \ + libminiupnpc-dev \ + libnotify-dev \ + libnuma-dev \ + libopus-dev \ + libpulse-dev \ + libssl-dev \ + libva-dev \ + libvdpau-dev \ + libwayland-dev \ + libx11-dev \ + libxcb-shm0-dev \ + libxcb-xfixes0-dev \ + libxcb1-dev \ + libxfixes-dev \ + libxrandr-dev \ + libxtst-dev \ + udev \ + wget +if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then + apt-get install -y --no-install-recommends \ + libmfx-dev +fi +apt-get clean +rm -rf /var/lib/apt/lists/* +_DEPS + +#Install Node +# hadolint ignore=SC1091 +RUN <<_INSTALL_NODE +#!/bin/bash +set -e +node_version="20.9.0" +wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash +source "$HOME/.nvm/nvm.sh" +nvm install "$node_version" +nvm use "$node_version" +nvm alias default "$node_version" +_INSTALL_NODE + +# install cuda +# https://developer.nvidia.com/cuda-toolkit-archive +# hadolint ignore=SC3010 +RUN <<_INSTALL_CUDA +#!/bin/bash +set -e +if [[ "${TARGETPLATFORM}" == 'linux/amd64' ]]; then + cuda_arch="x86_64" +elif [[ "${TARGETPLATFORM}" == 'linux/arm64' ]]; then + cuda_arch="sbsa" +else + echo "Unsupported platform: ${TARGETPLATFORM}" + exit 1 +fi +url="https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/${cuda_arch}/cuda-keyring_1.0-1_all.deb" +wget "$url" --progress=bar:force:noscroll -q --show-progress -O ./cuda-keyring.deb +dpkg -i cuda-keyring.deb +apt-get update +apt-get -y install --no-install-recommends \ + cuda +apt-get clean +rm -rf /var/lib/apt/lists/* +_INSTALL_CUDA