Skip to content

Docker

Docker is a toolchain for developing and publishing containers

Common Commands

Start and Run Container

docker run --rm -it --entrypoint sh <container>

Free up disk space

sudo docker system prune -a --volumes

selinux and docker volumes

Add the z option to fix permission denied errors when mounting files/directories into containers.

version: "3.9"
services:
    restic:
        image: "restic/restic"
        environment:
        volumes:
            - ./restic.sh:/restic.sh:z

Setup docker logs rotation

/etc/docker/daemon.json
{
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "10m",
        "max-file": "10"
    }
}

Networking

Bridge network

A bridge network creates a internal network within a single Docker host. Containers running on bridge networks are isolated from the host's network.


Last update: August 11, 2023
Created: June 3, 2023