I’ve been using WSL2 for developing for both personal and Professional use cases. To manage and quick deploy the containers, I’ve been using Portainer. As much as I love to use Terminal, i’m mostly lazy.
I’m assuming you’ve already WSL2 installed and docker is up and running.
First create a volume with following.
1 docker volume create portainer_data
Now, install Portainer
1 2 3 4 5 6 7 8 docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
Here, Port 9000 is used for serving UI and API. Port 8000 is for running SSH tunnel between portainer instance and the agent.
Now, set a admin password
Now, Select Docker as Environment and click Connect
Here it is,
To pull images from Docker hub go to images on left menu, type in the name of the container and tag e.g node:current-alpine3.10. click on Pull the Image.
you can import of your own container and spin off the containers.