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

Cannot install maui-android workload on Ubuntu 24.04 in Docker #41123

Closed
klemmchr opened this issue May 22, 2024 · 9 comments
Closed

Cannot install maui-android workload on Ubuntu 24.04 in Docker #41123

klemmchr opened this issue May 22, 2024 · 9 comments
Labels
Area-Workloads untriaged Request triage from a team member

Comments

@klemmchr
Copy link

klemmchr commented May 22, 2024

Description

I try to install the maui-android workload on Ubuntu 24.04 in Docker. The installation fails because the workload could not be found. Installing other workloads (like wasm-tools) works without any error.

FROM ubuntu:noble

RUN apt update
RUN apt install -y dotnet-sdk-8.0
RUN dotnet workload install maui-android

Console output

 > [4/4] RUN dotnet workload install maui-android:
0.372
0.373 Welcome to .NET 8.0!
0.373 ---------------------
0.373 SDK Version: 8.0.105
0.520
0.520 ----------------
0.520 Installed an ASP.NET Core HTTPS development certificate.
0.520 To trust the certificate, view the instructions: https://aka.ms/dotnet-https-linux
0.521
0.521 ----------------
0.521 Write your first app: https://aka.ms/dotnet-hello-world
0.521 Find out what's new: https://aka.ms/dotnet-whats-new
0.521 Explore documentation: https://aka.ms/dotnet-docs
0.521 Report issues and find source on GitHub: https://github.com/dotnet/core
0.521 Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
0.521 --------------------------------------------------------------------------------------
0.590 Workload ID maui-android is not recognized.

Steps to Reproduce

Use Dockerfile from above and build it

Link to public reproduction project repository

No response

Version with bug

Unknown/Other

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Other (Tizen, Linux, etc. not supported by Microsoft directly)

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@drasticactions
Copy link

@jonathanpeppers Is there a maui-android workload for Linux?

@klemmchr
Copy link
Author

There is for jammy. We are using 22.04 right now and it can be installed without any issue.

@PureWeen PureWeen transferred this issue from dotnet/maui May 23, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Workloads untriaged Request triage from a team member labels May 23, 2024
@baronfel
Copy link
Member

@klemmchr you're using the distro-built SDKs, not the MS-provided SDKs, right? In that case you're hitting dotnet/source-build#3242. We're working with the MAUI teams to make their workloads compatible with the Source-Built SDKs (which the distros use) but for now there's not really a great workaround that doesn't involve mucking around in your SDK install. Please follow that issue for updates.

@baronfel baronfel closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
@akoeplinger
Copy link
Member

akoeplinger commented May 23, 2024

An alternative is to install the Microsoft build of the SDK manually from the .tar.gz as detailed in https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#manual-install

@klemmchr
Copy link
Author

@baronfel I can reproduce this issue using the MS-provided SDKs.

This is a sample Dockerfile for jammy (working):

FROM ubuntu:jammy

ENV \
    # UID of the non-root user 'app'
    APP_UID=1654 \
    # Configure web servers to bind to port 8080 when present
    ASPNETCORE_HTTP_PORTS=8080 \
    # Enable detection of running in a container
    DOTNET_RUNNING_IN_CONTAINER=true \
    # Add global tools to path
    PATH=/root/.dotnet/tools:$PATH \
    # Do not generate dev certificates
    DOTNET_GENERATE_ASPNET_CERTIFICATE=false \
    # Do not show first run text
    DOTNET_NOLOGO=true \
    # Use polling file watcher
    DOTNET_USE_POLLING_FILE_WATCHER=true

RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -y --no-install-recommends \
        ca-certificates \
        wget \
        libatomic1 \
        libc6 \
        libgcc-s1 \
        libgssapi-krb5-2 \
        libicu70 \
        liblttng-ust1 \
        libssl3 \
        libstdc++6 \
        libunwind8 \
        tzdata \
        zlib1g \
    && rm -rf /var/lib/apt/lists/*

RUN wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
    dpkg -i packages-microsoft-prod.deb && \
    rm packages-microsoft-prod.deb && \
    apt update && \
    apt install -y dotnet-sdk-8.0 && \
    rm -rf /var/lib/apt/lists/*

RUN dotnet workload install maui-android

This is a sample Dockerfile for noble (not working):

FROM ubuntu:noble

ENV \
    # UID of the non-root user 'app'
    APP_UID=1654 \
    # Configure web servers to bind to port 8080 when present
    ASPNETCORE_HTTP_PORTS=8080 \
    # Enable detection of running in a container
    DOTNET_RUNNING_IN_CONTAINER=true \
    # Add global tools to path
    PATH=/root/.dotnet/tools:$PATH \
    # Do not generate dev certificates
    DOTNET_GENERATE_ASPNET_CERTIFICATE=false \
    # Do not show first run text
    DOTNET_NOLOGO=true \
    # Use polling file watcher
    DOTNET_USE_POLLING_FILE_WATCHER=true

RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive \
    apt-get install -y --no-install-recommends \
        ca-certificates \
        wget \
        libc6 \
        libgcc-s1 \
        libicu74 \
        liblttng-ust1 \
        libssl3 \
        libstdc++6 \
        libunwind8 \
        tzdata \
        zlib1g \
    && rm -rf /var/lib/apt/lists/*

RUN wget https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
    dpkg -i packages-microsoft-prod.deb && \
    rm packages-microsoft-prod.deb && \
    apt update && \
    apt install -y dotnet-sdk-8.0 && \
    rm -rf /var/lib/apt/lists/*

RUN dotnet workload install maui-android

I cannot say for sure that the MS-provided SDKs are even installed on noble. According to the docs there is no Microsoft feed for noble.

Installing .NET via manual install is not an option to me. I need a solution where the latest SDK gets installed automatically without manual configuration from my side.

@akoeplinger
Copy link
Member

I cannot say for sure that the MS-provided SDKs are even installed on noble.

Correct, the packages.microsoft.com repo for Ubuntu 24.04 doesn't contain 8.0 SDKs so you're installing from Ubuntu's repo: https://packages.microsoft.com/ubuntu/24.04/prod/pool/main/d/

Installing .NET via manual install is not an option to me. I need a solution where the latest SDK gets installed automatically without manual configuration from my side.

You could use the dotnet-install.sh script which handles installing the latest version: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install

@klemmchr
Copy link
Author

Correct, the packages.microsoft.com repo for Ubuntu 24.04 doesn't contain 8.0 SDKs so you're installing from Ubuntu's repo: https://packages.microsoft.com/ubuntu/24.04/prod/pool/main/d/

Why is Microsoft not publishing the 8.0 SDKs in their repo, especially when the distro-build SDKs are not suited for installing certain workloads?

You could use the dotnet-install.sh script which handles installing the latest version: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install

Using magic install scripts in Dockerfiles is heavily discouraged since it poses a security risk and makes the installation intransparent.

@akoeplinger
Copy link
Member

Why is Microsoft not publishing the 8.0 SDKs in their repo, especially when the distro-build SDKs are not suited for installing certain workloads?

There's more background in dotnet/core#9258. I wasn't involved in the discussions so I'm not sure people were aware of the MAUI workloads limitation.

Using magic install scripts in Dockerfiles is heavily discouraged since it poses a security risk and makes the installation intransparent.

You can read the source of the script, it essentially downloads and unpacks the .tar.gz, which is why I suggested the manual install 😄 But anyway this was meant to give a workaround, the real fix is putting the workload manifests into source-built SDKs: dotnet/source-build#3242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Workloads untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

4 participants