Does docker engine (not Desktop) support Linux containers on Windows 11?



  • I've installed docker engine according to the following instructions: https://docs.docker.com/engine/install/binaries/#install-server-and-client-binaries-on-windows

    I'm trying to run Linux containers on Windows 11, without Docker Desktop:

    PS C:\> docker run -d -p 80:80 docker/getting-started
    Unable to find image 'docker/getting-started:latest' locally
    latest: Pulling from docker/getting-started
    docker: no matching manifest for windows/amd64 10.0.22000 in the manifest list entries.
    See 'docker run --help'.
    

    I believe I'm getting the above error because dockerd is configured for Windows containers:

    PS C:\> docker info  -f '{{.OSType}}/{{.Architecture}}'
    windows/x86_64
    

    I've tried to use DockerCli.exe -SwitchLinuxEngine however it doesn't seem to have been installed:

    PS C:\> DockerCli.exe
    DockerCli.exe : The term 'DockerCli.exe' is not recognized as the name of a cmdlet ...
    

    How can I switch to Linux containers?



  • Using the following guide, I'm able to use docker on Windows without Docker Desktop. It may not be exactly true to my original question but meets my use case. https://dev.to/bowmanjd/install-docker-on-windows-wsl-without-docker-desktop-34m9

    Summarising the guide (in case it disappears from the internet):

    • Install WSL and check it's version 2: https://docs.microsoft.com/en-us/windows/wsl/install-win10#step-2---update-to-wsl-2
    • Install a Linux distribution: https://aka.ms/wslstore (I went with Ubuntu)
    • Add a non-root user (optional)
    • Upgrade any packages to the latest (e.g. on Ubuntu use sudo apt update && sudo apt upgrade
    • Install docker engine to your Linux distro: https://docs.docker.com/engine/install/
    • (Ubuntu) Switch over to using iptables sudo update-alternatives --config iptables
    • (Ubuntu) Add your user to the docker group sudo usermod -aG docker $USER
    • Start the docker daemon sudo service docker start
    • Run the hello-world container: docker run --rm hello-world

    I won't accept my own answer for now, in the hope that someone finds a better way



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2