Container creation error in Github codespace using a repo forked from microsoft learn

45 Views Asked by At

Hi I am trying to follow the instructions from ms learns module "Create a build pipeline with Azure Pipelines". I am following the "Github Codespaces development environment using a self-hosted agent" version. I have forked the repo from the microsoft site. But when I create a codespace the process fails and i get a "Running in recovery mode due to container error" message.
Error code: 1302 (UnifiedContainersErrorFatalCreatingContainer)

after 372 log lines I get the following error: #17 3.695 /usr/bin/apt 2024-03-05 22:22:18.797Z: #17 3.791 #17 3.791 WARNING: apt2024-03-05 22:22:18.941Z: does not have a stable CLI interface. Use with caution in scripts.2024-03-05 22:22:18.946Z: 2024-03-05 22:22:18.966Z: #17 3.791

and later 68 Reading state information... 6.087 E: Unable to locate package liblttng-ust0 6.107 'apt' failed with exit code '0' 6.107 Can't install dotnet core dependencies. 6.107 Please make sure that required repositories are connected for relevant package installer. 6.107 For issues with dependencies installation (like 'dependency was not found in repository' or 'problem retrieving the repository index file') - you can reach out to distribution owner for futher support. 6.107 You can manually install all required dependencies based on following documentation2024-03-05 22:22:23.185Z:

As I am new to codespaces I wonder if anyone kbows what is going on here (and how to fix it). Also curiuos if anyone else tried this module and had the problems.

Cheers

FROM mcr.microsoft.com/devcontainers/dotnet:6.0

# Install NodeJS
# [Choice] Node.js version: none, lts/*, 18, 16, 14
ARG NODE_VERSION="16"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 
0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION}  
2>&1"; fi

# Install Gulp
RUN npm install --global gulp-cli

RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash

# [Optional] Install zsh
ARG INSTALL_ZSH="true"
# [Optional] Upgrade OS packages to their latest versions
ARG UPGRADE_PACKAGES="false"

# Install needed packages and setup non-root user. Use a separate 
RUN statement to add your own dependencies.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
COPY library-scripts/*.sh /tmp/library-scripts/
RUN bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" 
"${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" 
"true" "true"

# cd into the user directory, download and unzip the Azure DevOps 
agent
RUN cd /home/vscode && mkdir azure-pipelines && cd azure-pipelines

# input Azure DevOps agent arguments
ARG ARCH="x64"
ARG AGENT_VERSION="2.206.1"

#RUN cd /home/vscode/azure-pipelines \
    && curl -O -L 
https://vstsagentpackage.azureedge.net/agent/${AGENT_VERSION}/vsts- 
agent-linux-${ARCH}-${AGENT_VERSION}.tar.gz \
    && tar xzf /home/vscode/azure-pipelines/vsts-agent- 
linux-${ARCH}-${AGENT_VERSION}.tar.gz \
    && /home/vscode/azure-pipelines/bin/installdependencies.sh

# copy over the start.sh script
COPY library-scripts/start.sh /home/vscode/azure-pipelines/start.sh

# Apply ownership of home folder
RUN chown -R vscode ~vscode

# make the script executable
RUN chmod +x /home/vscode/azure-pipelines/start.sh

# Clean up
RUN rm -rf /var/lib/apt/lists/* /tmp/library-scripts
0

There are 0 best solutions below