C#C
C#15mo ago
NykyTV

Problem with the dotnet installation in gitlab-ci (Docker, Debian11)

im using the official dotnet-install.sh script in the install stage
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script

this is my current .gitlab-ci.yml:

stages:
  - install
  - build

install-job:
  stage: install
  script:
    - apt-get update
    - apt-get install sudo
    - apt-get install curl -y
    - apt-get install wget -y
    - chmod +x dotnet-install.sh
    - sudo ./dotnet-install.sh --runtime dotnet --version 8.0.0
  tags:
    - .net
    - c#

build-job:
  stage: build
  script:
    - dotnet --version
    - echo "Compiling the code..."
    - dotnet build
    - echo "Compile complete."
  tags:
    - .net
    - c#


build-job error:
$ dotnet --version
/bin/bash: line 147: dotnet: command not found


I have been looking for solutions for over 2 hours now, but nothing has worked. Can anyone help me?
Was this page helpful?