Skip to content

Container Runtime Setup

Choose your preferred container runtime environment. We recommend either Docker or Podman.

Docker Installation

  1. Install Docker Desktop:

    • Download Docker Desktop
    • Run the installer
    • During installation, ensure "WSL 2" option is selected
  2. Post-installation:

    docker --version
    docker compose version
    
  3. Test Docker

    docker run hello-world
    
  4. Configure WSL 2 (if not already done):

    wsl --install
    

  1. Install Docker Desktop using Homebrew:

        brew install --cask docker
    

  2. Start Docker Desktop:

        open -a Docker
    
  3. Wait for Docker to start, then verify

    docker --version
    docker compose version
    
  4. Test Docker

    docker run hello-world
    
  5. Optional: Add Docker completion to your shell (for zsh):

    echo 'zstyle ":completion:*:*:docker:*" option-stacking yes' >> ~/.zshrc
    echo 'zstyle ":completion:*:*:docker-*:*" option-stacking yes' >> ~/.zshrc
    
  1. Install Docker Engine:

    # Add Docker's official GPG key
    sudo apt-get update
    sudo apt-get install ca-certificates curl gnupg
    sudo install -m 0755 -d /etc/apt/keyrings
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    sudo chmod a+r /etc/apt/keyrings/docker.gpg
    
  2. Add the repository to Apt sources

    echo \
      "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
      "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
      sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    
  3. Install Docker packages

    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    

  4. Post-installation steps:

    # Add your user to the docker group
    sudo usermod -aG docker $USER
    
  5. Apply group changes (or log out and back in)

    newgrp
    

  6. Test Docker

    docker run hello-world
    

Podman Installation

  1. Install Podman Desktop:

    • Download Podman Desktop
    • Run the installer - Follow the installation wizard
  2. Verify installation:

    podman --version
    podman machine init
    podman machine start
    

  1. Install Podman using Homebrew:

    brew install podman
    

  2. Initialize and start Podman:

    # Initialize Podman machine
    podman machine init
    
    # Start Podman machine
    podman machine start
    
    # Verify installation
    podman --version
    
    # Test Podman
    podman run hello-world
    
  3. Optional: Add Podman completion to your shell (for zsh):

    echo 'autoload -Uz compinit' >> ~/.zshrc
    echo 'compinit' >> ~/.zshrc
    

  1. Install Podman:

    # Ubuntu/Debian
    sudo apt-get update
    sudo apt-get install -y podman
    
  2. Verify installation

    podman --version
    

  3. Test Podman

    podman run hello-world
    

Container Compose Setup

Docker Compose is included with Docker Desktop for Windows and macOS.

For Linux:

# Install Docker Compose plugin
sudo apt-get update
sudo apt-get install docker-compose-plugin

    # Verify installation
    docker compose version
# Install Podman Compose using pip
pip3 install podman-compose

# Verify installation
podman-compose version

Container Configuration

Configure Docker resources (in Docker Desktop): 1. Open Docker Desktop 2. Go to Settings (⚙️) 3. Recommended settings: - CPUs: At least 2 - Memory: At least 4 GB - Swap: At least 1 GB - Disk image size: At least 60 GB

Configure Podman machine resources:

```{ .sh .copy } # Create a new machine with custom resources podman machine init --cpus 2 --memory 4096 --disk-size 60

# Start the machine
podman machine start

```

Verify Installation

Test your container environment with a simple container:

  1. Pull and run nginx

    docker run -d -p 8080:80 --name test-nginx nginx
    

  2. Check container status

    docker ps
    

  3. Stop and remove the container

        docker stop test-nginx
        docker rm test-nginx
    

  1. Pull and run nginx

    podman run -d -p 8080:80 --name test-nginx nginx
    

  2. Check container status

    podman ps
    

  3. Stop and remove the container

    podman stop test-nginx
    podman rm test-nginx
    

Troubleshooting

  1. Reset Docker Desktop

    docker system prune -a
    

  2. Check Docker status

    docker info
    

  3. View Docker logs

    docker logs <container-name>
    

  1. Reset Podman Machine

    podman machine stop
    podman machine rm
    podman machine init
    podman machine start
    

  2. Check Podman status

    podman info
    

  3. View Podman logs
    podman logs <container-name>