Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet feature fails to install on ubuntu:jammy #560

Closed
KIC opened this issue May 24, 2023 · 3 comments · Fixed by #590
Closed

dotnet feature fails to install on ubuntu:jammy #560

KIC opened this issue May 24, 2023 · 3 comments · Fixed by #590
Assignees
Labels
bug Something isn't working
Milestone

Comments

@KIC
Copy link

KIC commented May 24, 2023

using the dot net feature in a Dockerfile

FROM mcr.microsoft.com/vscode/devcontainers/base:jammy
LABEL maintainer="Bob codeql team"

# tzdata install needs to be non-interactive
ENV DEBIAN_FRONTEND=noninteractive

ARG USERNAME=vscode
ENV CODEQL_HOME /usr/local/codeql-home

# create user, install/update basics and python
# RUN adduser --home ${CODEQL_HOME} ${USERNAME} && \
RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y --no-install-recommends \
    	software-properties-common \
      nodejs \
    	vim \
    	curl \
    	wget \
    	git \
    	build-essential \
    	unzip \
    	apt-transport-https \
    	gnupg \
    	g++ \
    	make \
    	gcc \
    	apt-utils \
      rsync \
    	file \
      dos2unix \
    	gettext && \
      apt-get clean

# Install latest codeQL
RUN mkdir -p \
    ${CODEQL_HOME}/codeql-repo \
    /opt/codeql

# install codeql binary
RUN CODEQL_VERSION="v2.13.1" && \
    wget -q https://github.com/github/codeql-cli-binaries/releases/download/${CODEQL_VERSION}/codeql-linux64.zip -O /tmp/codeql_linux.zip && \
    unzip /tmp/codeql_linux.zip -d ${CODEQL_HOME} && \
    rm /tmp/codeql_linux.zip
ENV PATH="${CODEQL_HOME}/codeql:${PATH}"

# install language packs
RUN codeql pack download codeql/csharp-queries

and a devcontainer.json

	"build": {
		"dockerfile": "Dockerfile",
		"args": {
			"tag": "devcontainer"
		}
	},
	"features": {
		"ghcr.io/devcontainers/features/docker-in-docker:2": {},
		"ghcr.io/devcontainers/features/dotnet:1": { "version": "6.0" },
		"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
			"version": "1.22",
			"helm": "3.7",
			"minikube": "none"
		},
		"ghcr.io/devcontainers/features/azure-cli:1": {},
		"ghcr.io/devcontainers/features/node:1": {}
	},

fails installing the dotnet feature

(*) Installing .NET CLI...
Detected jammy on amd64. Attempting to install dotnet from apt
(!) No full or partial for package "dotnet-sdk" (resolved: "") match found in apt-cache for "6.0" on OS ubuntu jammy (amd64).
Continuing to fallback method if available
Failed to find requested version.
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:2 https://packages.microsoft.com/repos/azure-cli jammy InRelease [3575 B]
Get:3 https://packages.microsoft.com/repos/microsoft-ubuntu-jammy-prod jammy InRelease [3611 B]
Get:4 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:5 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [336 kB]
Get:6 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [497 kB]
Get:7 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [36.3 kB]
Get:8 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [920 kB]
Get:9 https://packages.microsoft.com/repos/azure-cli jammy/main amd64 Packages [786 B]
Get:10 https://packages.microsoft.com/repos/azure-cli jammy/main all Packages [1096 B]
Get:11 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:12 https://packages.microsoft.com/repos/microsoft-ubuntu-jammy-prod jammy/main amd64 Packages [65.1 kB]
Get:13 https://packages.microsoft.com/repos/microsoft-ubuntu-jammy-prod jammy/main all Packages [904 B]
Get:14 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [108 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
Get:16 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:19 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [776 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1158 kB]
Get:21 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [336 kB]
Get:22 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [42.2 kB]
Get:23 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [49.4 kB]
Get:24 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [27.0 kB]
Fetched 24.6 MB in 5s (5176 kB/s)
Reading package lists...
APT_DOTNET_VERSION =6.0.116-0ubuntu1~22.04.1 
DOTNET_PACKAGE dotnet-sdk-6.0-source-built-artifacts
Installing 'dotnet-sdk-6.0-source-built-artifacts=6.0.116-0ubuntu1~22.04.1 '...
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  dotnet-sdk-6.0-source-built-artifacts
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 2873 MB of archives.
After this operation, 2917 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 dotnet-sdk-6.0-source-built-artifacts amd64 6.0.116-0ubuntu1~22.04.1 [2873 MB]
Fetched 2873 MB in 4min 51s (9885 kB/s)
Selecting previously unselected package dotnet-sdk-6.0-source-built-artifacts.
(Reading database ... 64171 files and directories currently installed.)
Preparing to unpack .../dotnet-sdk-6.0-source-built-artifacts_6.0.116-0ubuntu1~22.04.1_amd64.deb ...
Unpacking dotnet-sdk-6.0-source-built-artifacts (6.0.116-0ubuntu1~22.04.1) ...
Setting up dotnet-sdk-6.0-source-built-artifacts (6.0.116-0ubuntu1~22.04.1) ...
./install.sh: line 234: dotnet: command not found
./install.sh: line 236: dotnet: command not found
Done!

which leads to a non existant dotnet binary

@samruddhikhandale
Copy link
Member

Hi 👋

Thanks for reporting!
@alexander-smolyakov can you help investigate the issue? Thanks!

@alexander-smolyakov
Copy link
Contributor

Hey @KIC, I have managed to reproduce the issue. At the moment, I'm trying to determine the root cause of it. As the temporal fix, could you please set the installUsingApt option to false for the dotnet feature?

"ghcr.io/devcontainers/features/dotnet:1": { 
            "version": "6",
            "installUsingApt": false
        },

Related doc: https://github.com/devcontainers/features/blob/main/src/dotnet/README.md#options

@alexander-smolyakov
Copy link
Contributor

It seems the issue is related to picking the wrong dotnet distribution from the packages repo. We have two distributions in the jammy repo:

dotnet-sdk-6.0 (6.0.116-0ubuntu1~22.04.1) [universe] [security]
  dotNET 6.0 Software Development Kit
dotnet-sdk-6.0-source-built-artifacts (6.0.116-0ubuntu1~22.04.1) [universe] [security]
  Internal package for building dotNet 6.0 Software Development Kit

For some reason feature picks dotnet-sdk-6.0-source-built-artifacts when it should pick dotnet-sdk-6.0. I will investigate how we can adjust feature behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants