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

Unable to Build WSLg #751

Closed
Zopolis4 opened this issue May 29, 2022 · 2 comments
Closed

Unable to Build WSLg #751

Zopolis4 opened this issue May 29, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Zopolis4
Copy link

Steps to reproduce

  1. Follow the build instructions in Contributing.md, except run sudo dockerd --iptables=false as per #8450.
    (Running regular sudo dockerd throws the same errors listed in the report.)
  2. Run the first command of step 2.2

Expected behavior

WSLg to build

Actual behavior

Instead, it throws this error:

== Install Git/CA certificates ==
curl#6: Couldn't resolve host name
Error: TDNFGetRepoMD 1207
Error: Failed to synchronize cache for repo 'CBL-Mariner Official Base 1.0 x86_64' from 'https://packages.microsoft.com/cbl-mariner/1.0/prod/base/x86_64/rpms'
curl#6: Couldn't resolve host name
Error: TDNFGetRepoMD 1207
Error: Failed to synchronize cache for repo 'CBL-Mariner Official Microsoft 1.0 x86_64' from 'https://packages.microsoft.com/cbl-mariner/1.0/prod/Microsoft/x86_64/rpms'
curl#6: Couldn't resolve host name
Error: TDNFGetRepoMD 1207
Error: Failed to synchronize cache for repo 'CBL-Mariner Official Update 1.0 x86_64' from 'https://packages.microsoft.com/cbl-mariner/1.0/prod/update/x86_64/rpms'
Error(1011) : No matching packages
Loaded plugin: tdnfrepogpgcheck
Refreshing metadata for: 'CBL-Mariner Official Base 1.0 x86_64'
Disabling Repo: 'CBL-Mariner Official Base 1.0 x86_64'
Refreshing metadata for: 'CBL-Mariner Official Microsoft 1.0 x86_64'
Disabling Repo: 'CBL-Mariner Official Microsoft 1.0 x86_64'
Refreshing metadata for: 'CBL-Mariner Official Update 1.0 x86_64'
Disabling Repo: 'CBL-Mariner Official Update 1.0 x86_64'
No package git available
No package ca-certificates available
The command '/bin/sh -c echo "== Install Git/CA certificates ==" &&     tdnf install -y         git         ca-certificates' returned a non-zero code: 243
@Zopolis4 Zopolis4 added the bug Something isn't working label May 29, 2022
@elsaco
Copy link

elsaco commented May 30, 2022

@Zopolis4 when using WSL add --network=host to your docker build command, like:

sudo docker build --network=host -t system-distro-x64 ./wslg --build-arg SYSTEMDISTRO_VERSION=git --git-dir=wslg/.git rev-parse --verify HEAD --build-arg SYSTEMDISTRO_ARCH=x86_64

Docker network defaults to bridge and for some unknow (to me) reason it doesn't work inside WSL.

Here's sample build output, just the beginning, past your failure point:

sudo docker build --network=host -t system-distro-x64 ./wslg --build-arg SYSTEMDISTRO_VERSION=git --git-dir=wslg/.git rev-parse --verify HEAD --build-arg SYSTEMDISTRO_ARCH=x86_64
Sending build context to Docker daemon 942.3MB
Step 1/82 : FROM mcr.microsoft.com/cbl-mariner/base/core:1.0.20220226 AS build-env
---> 1c60c61ce2f6
Step 2/82 : RUN echo "== Install Git/CA certificates ==" && tdnf install -y git ca-certificates
---> Running in ef9a1248c053
== Install Git/CA certificates ==
Loaded plugin: tdnfrepogpgcheck
Refreshing metadata for: 'CBL-Mariner Official Base 1.0 x86_64'
Refreshing metadata for: 'CBL-Mariner Official Microsoft 1.0 x86_64'
Refreshing metadata for: 'CBL-Mariner Official Update 1.0 x86_64'

@Zopolis4
Copy link
Author

Yup, that fixed it. Should this be mentioned on the build documentation somewhere? The --iptables=false option for dockerd and the --network=host option for the docker build command? It seems a little annoying for someone with a default setup to have to find two separate issues on two separate repos.

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

No branches or pull requests

2 participants