Skip to content

Docker

Installation

Install Docker Engine

curl -fLsS https://get.docker.com/ | sh

Setup for Lima(optional)

Alias the limactl command as docker

alias docker="limactl shell docker docker"

Commands

Create docker volume

docker volume create <VOLUME> 

Format output container information

docker ps --format "table {{.ID}} {{.Names}} {{.Status}}"

Getting into Docker container's shell

docker exec -it <CONTAINER> /bin/sh

docker exec -it <CONTAINER> /bin/bash

View container logs

docker logs -f <CONTAINER>

Deleting unused data

docker system prune --all 

Deleting unused image

docker image prune -f

Killing the container immediately

docker kill <CONTAINER>

Formatting output

docker ps -a --format "table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}"
Back to top