Technology

Windows development environment with podman and git

Author Photo

Yui

· 2 min read
Thumbnail

Introduction

I will share how I have setup my windows machine for development. I’m using Podman, a lightweight container engine for most of my coding.

Prerequisites

  • Windows 10 or 11 with WSL 2 enabled
  • Administrator privileges

Tools

Installation

1. Chocolatey

  • open a PowerShell windows as administrator
Set-ExecutionPolicy Bypass -Scope CurrentUser -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

2. Visual Studio Code

  • install vscode or other editor, but vscode is recommended for devcontainers.
  • install gsudo as sudo replacament for windows
choco install vscode gsudo -y

3. Native (optional)

  • for languages that might be better to run natively just install them
choco install golang -y

3. Podman

wsl --install --no-distribution
  • Follow any on-screen instructions for rebooting if prompted.

  • install podman

  • you can skip podman desktop if you don’t need docker-compose or don’t want a GUI for podman.

choco install podman-cli podman-desktop -y
podman machine init
podman machine set --rootful
podman machine start
  • To setup docker compose open podman desktop and Enable extensions: podman, compose then Settings -> Resources -> Compose -> setup

4. Devcontainers

  1. If you’re using Visual Studio Code for development, consider installing the “Remote Containers” extension:
    • Open VS Code and go to Extensions (Ctrl+Shift+X).
    • Search for “Remote Containers” and install the extension by Microsoft.

Configuring VS Code for Podman

Set these 2 vscode settings.

"dev.containers.dockerPath": "podman"
"dev.containers.mountWaylandSocket": false

Warning: Some things may behave weird unless u use WSL file storage or open the project via Dev Containers: Clone repository into named volume.

5. GPG Signing(Optional)

  • Install GnuPG and Keybase
  • Setup the keys
choco install gnupg keybase -y
# login
keybase login

# setup key
keybase pgp export --outfile keybase-public.key
keybase pgp export --secret --outfile keybase-private.key

gpg --allow-secret-key-import --import keybase-private.key
gpg --import keybase-public.key

# edit key --> trust -> 5 -> save
gpg --edit-key <email>
del keybase-private.key keybase-public.key 

6. Git configuration

choco install git -y

## Basic config
git config --global user.email <email>
git config --global user.name <name>

## Setting up commit signing (Needs gpg setup first!)
gpg --list-secret-keys --keyid-format=long
# id the part after the slash eg: rsa4096/id
git config --global user.signingkey <Key ID>
git config --global commit.gpgsign true

# Sanity check
git config --global -l
#windows#computer#coding#podman#containers
Author Photo

About Yui