Use docker in WSL2 (Arch Linux)

date
Sep 4, 2022
slug
wsl2-docker
status
Published
tags
Others
summary
Podman YES
type
Post
Since docker requires systemd to run and WSL2 doesn’t have it, podman is the better option.
Podman is a daemon-free container manager, which is perfect for WSL!

Install Podman

podman-compose is like docker-compose, podman-docker allows you to run podman with docker commands.

Change registry setting for China

Use /etc/containers/registries.conf for global podman setting.

Run Hello-world!

Container DNS server

When containers want to communicate with each other with names, a dns server is needed.
Podman uses aardvark-dns as default dns server, before using we need to install it first.

TODO

non-sudo user
youki runtime
 

© Ric Li 2021 - 2024