diff --git a/Dockerfiles/Cpp/Dockerfile b/Dockerfiles/Cpp/Dockerfile index 67b64a0..d2245fa 100644 --- a/Dockerfiles/Cpp/Dockerfile +++ b/Dockerfiles/Cpp/Dockerfile @@ -84,10 +84,6 @@ RUN apt-get --fix-missing update && apt-get upgrade -y && \ update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-14 100 && \ update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-14 100 -# Install CLI -ARG TARGETARCH -COPY ./bin/velocitas-cli-$TARGETARCH /usr/bin/velocitas - # Install devcontainer features ADD https://raw.githubusercontent.com/devcontainers/features/7fa90110d762797cc0b1c2fe8fcc028c9b813d56/src/common-utils/install.sh /container/scripts/install-common.sh RUN UID="4000" bash /container/scripts/install-common.sh @@ -96,13 +92,15 @@ RUN VERSION="latest" bash /container/scripts/install-dind.sh COPY ./common/ /scripts/ +ARG TARGETARCH WORKDIR /scripts RUN ./install-python.sh && \ ./install-dapr-cli.sh && \ - ./install-k3d-prerequisites.sh \ - ./install-k3d-tooling.sh - + ./install-k3d-prerequisites.sh && \ + ./install-velocitas-cli.sh ${TARGETARCH} USER 4000 +RUN ./install-k3d-tooling.sh + ADD --chown=4000 https://raw.githubusercontent.com/eclipse-velocitas/vehicle-app-cpp-sdk/main/requirements.txt /container/requirements.txt # Install Python requirements as vscode user and clean up RUN pip3 install -r /container/requirements.txt && sudo rm /container/requirements.txt diff --git a/Dockerfiles/Python/Dockerfile b/Dockerfiles/Python/Dockerfile index 056265e..110156c 100644 --- a/Dockerfiles/Python/Dockerfile +++ b/Dockerfiles/Python/Dockerfile @@ -24,21 +24,20 @@ RUN apt-get update && apt-get upgrade -y && \ libstdc++6 zlib1g locales sudo ncdu man-db strace gnupg2 \ build-essential python3-dev -# Install CLI -ARG TARGETARCH -COPY ./bin/velocitas-cli-$TARGETARCH /usr/bin/velocitas - # Install devcontainer features ADD https://raw.githubusercontent.com/devcontainers/features/7fa90110d762797cc0b1c2fe8fcc028c9b813d56/src/common-utils/install.sh /tmp/scripts/install-common.sh RUN UID="4000" bash /tmp/scripts/install-common.sh ADD https://raw.githubusercontent.com/devcontainers/features/7fa90110d762797cc0b1c2fe8fcc028c9b813d56/src/docker-in-docker/install.sh /tmp/scripts/install-dind.sh RUN VERSION="latest" bash /tmp/scripts/install-dind.sh + COPY ./common/ /scripts/ +ARG TARGETARCH WORKDIR /scripts -RUN ./install-python.sh -RUN ./install-dapr-cli.sh -RUN ./install-k3d-prerequisites.sh +RUN ./install-python.sh && \ + ./install-dapr-cli.sh && \ + ./install-k3d-prerequisites.sh && \ + ./install-velocitas-cli.sh ${TARGETARCH} USER 4000 RUN ./install-k3d-tooling.sh diff --git a/bin/velocitas-cli-amd64 b/bin/velocitas-cli-amd64 deleted file mode 100755 index 3f983c1..0000000 --- a/bin/velocitas-cli-amd64 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:191a198e9c4d08b778f372d43e02fab7f055bb7cf65fce3cb66e6d4326bbaaa8 -size 60692727 diff --git a/bin/velocitas-cli-arm64 b/bin/velocitas-cli-arm64 deleted file mode 100755 index 8457653..0000000 --- a/bin/velocitas-cli-arm64 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c7c363d3195448de2c8b65f59794ab4a0faafed8bfcfddae07e9e2cd5c03a7b8 -size 59215158 diff --git a/common/install-dapr-cli.sh b/common/install-dapr-cli.sh index 5398f4a..9922c7f 100755 --- a/common/install-dapr-cli.sh +++ b/common/install-dapr-cli.sh @@ -14,7 +14,7 @@ # SPDX-License-Identifier: Apache-2.0 echo "#######################################################" -echo "### Install dapr-cli ###" +echo "### Install dapr-cli ###" echo "#######################################################" DEFAULT_DAPR_CLI_VERSION=$(cat AppManifest.json | jq .[].dependencies.dapr.cli.version | tr -d '"') diff --git a/common/install-velocitas-cli.sh b/common/install-velocitas-cli.sh new file mode 100755 index 0000000..0860c73 --- /dev/null +++ b/common/install-velocitas-cli.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Copyright (c) 2022 Robert Bosch GmbH +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +echo "#######################################################" +echo "### Install Velocitas CLI ###" +echo "#######################################################" + +CLI_ASSET_NAME=velocitas-linux-$(echo $1 | sed 's/amd64/x64/g') +CLI_INSTALL_PATH=/usr/bin/velocitas + +CLI_DOWNLOAD_URL="https://github.com/eclipse-velocitas/cli/releases/latest/download/${CLI_ASSET_NAME}" + +curl -L ${CLI_DOWNLOAD_URL} -o "${CLI_INSTALL_PATH}" +chmod +x "${CLI_INSTALL_PATH}" + +CLI_VERSION=$( "${CLI_INSTALL_PATH}" --version ) + +echo "Installed CLI version: ${CLI_VERSION}"