Docker + Docker Compose

Container platform -- Docker CLI and Compose installed via Homebrew

Quick summary

Docker is a platform for developing, shipping, and running applications in containers. Docker Compose lets you define and run multi-container applications with a single docker compose command. The Docker CLI is installed via Homebrew and connects to Docker Desktop through WSL2 integration.

Common tasks

Basic Usage

docker ps

Basic Usage

docker ps -a

Basic Usage

docker images

Basic Usage

docker pull ubuntu:latest

What is it?

Docker is a platform for developing, shipping, and running applications in containers. Docker Compose lets you define and run multi-container applications with a single docker compose command. The Docker CLI is installed via Homebrew and connects to Docker Desktop through WSL2 integration.

Basic Usage

List running containers:

$docker ps
$docker ps -a

Manage images:

$docker images
$docker pull ubuntu:latest
$docker rmi ubuntu:latest

Start and stop Compose services:

$docker compose up -d
$docker compose down
$docker compose logs -f

Execute commands in a running container:

$docker exec -it my-container bash
$docker exec my-container ls -la

View container logs:

$docker logs my-container
$docker logs -f my-container

Tips

Enable Docker Desktop WSL2 integration in Docker Desktop Settings -> Resources -> WSL Integration.
The bootstrapper script adds your user to the docker group.
The Docker socket at /var/run/docker.sock must exist for the CLI to connect.