Skip to content

Docker: Volumes & networks

4 Docker commands: Volumes & networks. Click a command to see what each part does.

Index
4 items
Click a command to see what each part does.

Volumes & networks4

  • docker volume ls; docker volume create <name>; docker volume rm <name>List / create / remove volumesCaution

    What each part does

    1. volume lsnamed volumes (persistent data)
    2. volume create <name>create one (docker run -v <name>:/path also creates it)
    3. volume rm <name>delete it and its data
  • docker run -d -v <volume>:<container-path> <image>Mount a named volume into a container

    What each part does

    1. -v <volume>:<container-path>data written to <container-path> survives container removal
  • docker network ls; docker network create <name>List / create networks

    What each part does

    1. network lsbridge, host, none + your own networks
    2. network create <name>user-defined bridge: containers on it reach each other by name
  • docker run -d --name <name> --network <network> <image>Run a container on a network

    What each part does

    1. --network <network>attach to that network; other containers can reach it as http://<name>

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…