DEV Community

Mircea Sirghi
Mircea Sirghi

Posted on • Edited on

1

Run Docker from WSL

Introduction

This article is a complete guide on how to setup WSL on windows and run docker, Kafka, Kubernetes commands directly from GitBash console without having to open WSL.

Additionally I have added the setup to use Java Test Containers.

The whole purpose is for anyone who wants to migrate to a new distribution or to change machines, or has to fix a broken WSL, in just a few steps the environment is prepared rapidly without the need to investigate the internet on each particular problem.

Preparing WSL with docker

First part is preparing windows to use docker from WSL without Docker Desktop.

Adding Java Test Containers

I observed that I can also automate the part to add Java Test Containers so this is the second part. So that anytime WSL gets broken or I want to switch to a new linux distribution or to change laptops, I can allway run the same commands and expect it works.

Setting up Kubernetes

Third part is how I setup Kubernetes through WSL.

Kafka setup

I will add setting up Kafka soon. Currently I am looking to change the whole approach to using just Kubernetes.

Note: I have removed scripts to enable docker on Powershell and CMD as I have never used them and find them redundant.

On Github

TBC

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more