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 Use Compose with Windows Containers #3808

Open
nerddtvg opened this issue Jan 10, 2025 · 1 comment
Open

Unable to Use Compose with Windows Containers #3808

nerddtvg opened this issue Jan 10, 2025 · 1 comment
Labels
area/compose bug Something isn't working platform/Windows/Non-WSL2 Microsoft Windows (non-WSL2)

Comments

@nerddtvg
Copy link

Description

When running nerdctl compose up, by default a --hostname parameter is passed to nerdctl run which is invalid on Windows OS.

https://github.com/containerd/nerdctl/blob/v2.0.2/pkg/containerutil/container_network_manager_windows.go#L50-L64

https://github.com/containerd/nerdctl/blob/v2.0.2/pkg/composer/serviceparser/serviceparser.go#L608-L614

Steps to reproduce the issue

  1. Use a similar docker-compose.yaml file:
    services:
      github:
        image: mcr.microsoft.com/dotnet/runtime:8.0-windowsservercore-ltsc2019
        isolation: hyperv
        platform: windows/amd64
        restart: unless-stopped
        scale: 1
        # Hostname gets set and causes problem
  2. nerdctl compose up

Describe the results you received and expected

We would expect the container to be started successfully.

> nerdctl compose up
time="2025-01-10T18:35:02Z" level=warning msg="Ignoring: service github: [Isolation]"
time="2025-01-10T18:35:02Z" level=info msg="Ensuring image mcr.microsoft.com/dotnet/runtime:8.0-windowsservercore-ltsc2019"
time="2025-01-10T18:35:02Z" level=info msg="Creating container runners-github-1"
time="2025-01-10T18:35:02Z" level=info msg="Running [C:\\Program Files\\nerdctl\\nerdctl.exe run --cidfile=C:\\Users\\user\\AppData\\Local\\Temp\\2\\compose-2714756652\\cid -l=com.docker.compose.project=runners -l=com.docker.compose.service=github -d --name=runners-github-1 --pull=never --net=runners_default --hostname=github --platform=windows/amd64 --restart=unless-stopped mcr.microsoft.com/dotnet/runtime:8.0-windowsservercore-ltsc2019]"
time="2025-01-10T18:35:03Z" level=fatal msg="failed to verify networking settings: the following networking arguments are not supported on Windows: [--hostname]"
time="2025-01-10T18:35:03Z" level=fatal msg="error while creating container runners-github-1: error while creating container runners-github-1: exit status 1"

What version of nerdctl are you using?

nerdctl version
time="2025-01-10T18:36:06Z" level=warning msg="unable to determine runc version: exec: \"runc\": executable file not found in %PATH%"
Client:
 Version:       v2.0.2
 OS/Arch:       windows/amd64
 Git commit:    1220ce7ec2701d485a9b1beeea63dae3da134fb5
 buildctl:
  Version:      v0.18.2
  GitCommit:    e4da654b1251f91e914fab18eba33743aefd7080

Server:
 containerd:
  Version:      v2.0.1
  GitCommit:    88aa2f531d6c2922003cc7929e51daf1c14caa0a
 runc:
  Version:

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

Windows Server 2019

Microsoft Windows [Version 10.0.17763.6659]
@nerddtvg nerddtvg added the kind/unconfirmed-bug-claim Unconfirmed bug claim label Jan 10, 2025
@AkihiroSuda AkihiroSuda added bug Something isn't working platform/Windows/Non-WSL2 Microsoft Windows (non-WSL2) area/compose and removed kind/unconfirmed-bug-claim Unconfirmed bug claim labels Jan 10, 2025
@apostasie
Copy link
Contributor

Wondering if we should just null m.netOpts.Hostname and issue a warning instead of hard failing on it.

@AkihiroSuda wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/compose bug Something isn't working platform/Windows/Non-WSL2 Microsoft Windows (non-WSL2)
Projects
None yet
Development

No branches or pull requests

3 participants