{
  "version": 1,
  "collections": [
    {
      "id": "0768115e-d64a-5046-a660-02183b43c561",
      "name": "docker",
      "color": "#2496ed"
    }
  ],
  "snippets": [
    {
      "id": "8de4dc5f-fe8e-5ee1-94cb-7e2ecf78ab52",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Run a throwaway container with a shell",
      "body": "docker run --rm -it {{image}} {{shell:sh|bash}}",
      "description": "",
      "tags": [
        "containers"
      ]
    },
    {
      "id": "38fe7ba7-eb89-5f52-9d46-2f3bd70426fa",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Run in the background with a port",
      "body": "docker run -d --name {{name}} -p {{host_port:8080}}:{{container_port:80}} {{image}}",
      "description": "",
      "tags": [
        "containers"
      ]
    },
    {
      "id": "64ce29b0-3676-514d-9e83-3c5892e98b33",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Run with the current folder mounted",
      "body": "docker run --rm -it -v \"$(pwd)\":/app -w /app {{image}} {{shell:sh|bash}}",
      "description": "",
      "tags": [
        "containers"
      ]
    },
    {
      "id": "d3045ec1-a5e9-59d8-a2db-e883b9d0fefc",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Run with an env file",
      "body": "docker run --rm --env-file {{env_file:.env}} {{image}}",
      "description": "",
      "tags": [
        "containers"
      ]
    },
    {
      "id": "2288a46c-1acd-57a3-bf0d-9e3171f160be",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "List running containers",
      "body": "docker ps",
      "description": "",
      "tags": [
        "containers"
      ]
    },
    {
      "id": "fe5d9afa-fcff-51b0-b9f8-07fddca26391",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "List all containers",
      "body": "docker ps -a",
      "description": "",
      "tags": [
        "containers"
      ]
    },
    {
      "id": "02748824-1ff0-52e4-b662-94a066f6845b",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Shell into a running container",
      "body": "docker exec -it {{container}} {{shell:sh|bash}}",
      "description": "",
      "tags": [
        "containers"
      ]
    },
    {
      "id": "2ea089b7-4c8d-5f29-b887-a65f2a1d872b",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Follow a container’s logs",
      "body": "docker logs -f --tail {{lines:100}} {{container}}",
      "description": "",
      "tags": [
        "containers"
      ]
    },
    {
      "id": "43e30899-5764-563b-8c7c-6d7eac3c337e",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Stop and remove a container",
      "body": "docker rm -f {{container}}",
      "description": "",
      "tags": [
        "containers"
      ]
    },
    {
      "id": "2629c3ce-cb49-51a5-bc28-9b08cf1b88ea",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Copy a file out of a container",
      "body": "docker cp {{container}}:{{path}} {{dest:.}}",
      "description": "",
      "tags": [
        "containers"
      ]
    },
    {
      "id": "c3910f41-2391-5963-81d6-dd93a3105ba2",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Live CPU and memory use",
      "body": "docker stats",
      "description": "",
      "tags": [
        "containers"
      ]
    },
    {
      "id": "f9dfe0b7-7086-5d56-bd07-af885e129da3",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Full details of a container",
      "body": "docker inspect {{container}}",
      "description": "",
      "tags": [
        "containers"
      ]
    },
    {
      "id": "212fd59e-f289-579b-85a9-dcc68d0630b1",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Build and tag an image",
      "body": "docker build -t {{name}}:{{tag:latest}} .",
      "description": "",
      "tags": [
        "images"
      ]
    },
    {
      "id": "272685d7-fa84-51f9-96ae-e50d7c3d9806",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Build for another platform",
      "body": "docker buildx build --platform {{platform:linux/amd64|linux/arm64}} -t {{name}}:{{tag:latest}} .",
      "description": "For example, building an x86 image on an Apple silicon Mac.",
      "tags": [
        "images"
      ]
    },
    {
      "id": "b5f4b1ee-0f27-551d-bf4b-7a837995d3ac",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Build without the cache",
      "body": "docker build --no-cache -t {{name}}:{{tag:latest}} .",
      "description": "",
      "tags": [
        "images"
      ]
    },
    {
      "id": "4eb3c5d9-b2fc-5741-8316-8073768db290",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "List images",
      "body": "docker images",
      "description": "",
      "tags": [
        "images"
      ]
    },
    {
      "id": "5d79f723-b4c3-5e48-9a40-e4074dcc55cc",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Pull an image",
      "body": "docker pull {{image}}",
      "description": "",
      "tags": [
        "images"
      ]
    },
    {
      "id": "949c6396-00f8-5392-a010-2e724e44108b",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Tag and push to a registry",
      "body": "docker tag {{image}} {{registry}}/{{image}} && docker push {{registry}}/{{image}}",
      "description": "",
      "tags": [
        "images"
      ]
    },
    {
      "id": "5968fd98-8d9a-56ca-97fa-befd3fbd361d",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Log in to a registry",
      "body": "docker login {{registry}}",
      "description": "",
      "tags": [
        "images"
      ]
    },
    {
      "id": "5ecdbde3-d4b5-547c-8995-18df13bc2146",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "See how an image’s layers were built",
      "body": "docker history {{image}}",
      "description": "",
      "tags": [
        "images"
      ]
    },
    {
      "id": "c4813a2b-6b02-5054-807e-f38c16fbc6cf",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "How much space Docker is using",
      "body": "docker system df",
      "description": "",
      "tags": [
        "cleanup"
      ]
    },
    {
      "id": "94716e1b-4b2d-5c7c-94c2-43423e715cf0",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Remove stopped containers",
      "body": "docker container prune -f",
      "description": "",
      "tags": [
        "cleanup"
      ]
    },
    {
      "id": "c6c73b6e-bb67-5c45-9944-c5b6e23bd89f",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Remove dangling images",
      "body": "docker image prune -f",
      "description": "",
      "tags": [
        "cleanup"
      ]
    },
    {
      "id": "2d92f7df-fbcd-57a2-896e-802ee6036a2d",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Remove everything unused",
      "body": "docker system prune -af --volumes",
      "description": "Deletes stopped containers, unused images, networks and volumes. Volume data is gone for good.",
      "tags": [
        "cleanup"
      ]
    },
    {
      "id": "61b4ff77-110d-5202-b21a-d8827d4e2572",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "List volumes",
      "body": "docker volume ls",
      "description": "",
      "tags": [
        "networks"
      ]
    },
    {
      "id": "a553b0f1-7141-5fb3-a1b2-f4ee26338745",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Create a network",
      "body": "docker network create {{network}}",
      "description": "",
      "tags": [
        "networks"
      ]
    },
    {
      "id": "03629c9c-0081-5562-b4b3-078524abd5b6",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Run a container on a network",
      "body": "docker run -d --network {{network}} --name {{name}} {{image}}",
      "description": "Containers on the same network reach each other by name.",
      "tags": [
        "networks"
      ]
    },
    {
      "id": "e5039b82-f836-5b3e-ac63-a9552f47b9ee",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Start everything in the background",
      "body": "docker compose up -d",
      "description": "",
      "tags": [
        "compose"
      ]
    },
    {
      "id": "13a90e37-a9d4-51a2-9111-19b4dbb07fd3",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Rebuild and start",
      "body": "docker compose up -d --build",
      "description": "",
      "tags": [
        "compose"
      ]
    },
    {
      "id": "f6da24e5-7908-5c4f-be71-2f5bd27e9be5",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Stop and remove, including volumes",
      "body": "docker compose down -v",
      "description": "",
      "tags": [
        "compose"
      ]
    },
    {
      "id": "dbab34c7-882f-577e-be25-a3a0a7061ffc",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "List services",
      "body": "docker compose ps",
      "description": "",
      "tags": [
        "compose"
      ]
    },
    {
      "id": "996ce0d6-e903-5e33-ad50-719dc01138f0",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Follow a service’s logs",
      "body": "docker compose logs -f {{service}}",
      "description": "",
      "tags": [
        "compose"
      ]
    },
    {
      "id": "7cf5c933-fcc6-5d76-814e-184fdda7f51d",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Shell into a service",
      "body": "docker compose exec {{service}} {{shell:sh|bash}}",
      "description": "",
      "tags": [
        "compose"
      ]
    },
    {
      "id": "9ea03045-bf3d-5b3f-b5fb-5e102ef54391",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Run a one-off command",
      "body": "docker compose run --rm {{service}} {{command}}",
      "description": "",
      "tags": [
        "compose"
      ]
    },
    {
      "id": "a404119f-bb13-5fff-bc8f-e12ada715f16",
      "collectionId": "0768115e-d64a-5046-a660-02183b43c561",
      "title": "Restart a service",
      "body": "docker compose restart {{service}}",
      "description": "",
      "tags": [
        "compose"
      ]
    }
  ]
}
