container enabled verified medium v1.0.0

docker

Container platform for developing, shipping, and running applications in isolated environments.

📋 Live Preview
docker {config} {context} {debug} {host} {log-level}
📎 config 📎 context 📎 debug 🌍 host → ip 📎 log-level
docker {config} {context} {debug} {host} {log-level}

Sandbox: docker · Timeout: 300s

Capabilities

container.runtime.execute
container.image.build
container.image.publish
container.orchestration.compose
container.storage.volume
container.network.manage

Parameters

Name Type Required Default Description Aliases
config string No - Location of client config files (default --config
context string No - Name of the context to use to connect to the -c, --context
debug string No - Enable debug mode -D, --debug
host string No - Daemon socket to connect to -H, --host
log-level string No - Set the logging level ("debug", "info" -l, --log-level
tls string No - Use TLS; implied by --tlsverify --tls
tlscacert string No - Trust certs signed only by this CA (default --tlscacert
tlscert file No - Path to TLS certificate file (default --tlscert
tlskey file No - Path to TLS key file (default --tlskey
tlsverify string No - Use TLS and verify the remote --tlsverify
version string No - Print version information and quit -v, --version

Artifacts

TypeDescriptionMIMESchemaTrust
container.image.ociBuilt or pulled OCI container imageapplication/vnd.oci.image.manifest.v1+json1.0.0verified
container.runtime.logsLog output from container executiontext/plain-verified

Contract

Inputs

container.image.dockerfile

Dockerfile for image build

container.image.oci

Base container image

Outputs

container.image.oci

Built or pulled container image

container.runtime.logs

Container execution logs

Side effects: network_trafficfilesystem_writeprocess_spawn

Workflow Edges

Produces

container.image.ocicontainer.runtime.logs

Consumes

container.image.dockerfilecontainer.image.oci

Resource Profile

ResourceValue
CPUhigh
Memory1024 MB
Networkhigh
Disk I/Ohigh

Examples

Run an interactive container

docker run -it --rm ubuntu:latest bash

Build an image from Dockerfile

docker build -t myapp:latest .

Run a web server with port mapping

docker run -d -p 80:80 --name web nginx:alpine

Execute command in running container

docker exec -it mycontainer ps aux

Darkiros UTILS: Remove docker image

docker image rm [image_id]

Darkiros UTILS: Delete an image from the local image store

docker rmi [image_id]

Darkiros UTILS: List all images that are locally stored with the Docker Engine

docker images

Darkiros UTILS: List all containers that are locally stored with the Docker Engine

docker ps -a

Darkiros UTILS: List all containers that are currently running

docker ps -q

Darkiros UTILS: Stop a running container

docker stop [container_id]

Darkiros UTILS: Stop all running containers

docker stop $(docker ps -a -q)

Darkiros UTILS: Build an image from the Dockerfile in the current directory and tag the image

docker build -t [image_name] .

Darkiros UTILS: Pull an image from a registry

docker pull [image_name]:[tag]

Darkiros UTILS: Create a new bash process inside the container and connect it to the terminal

docker exec -it [container_id] bash

Darkiros UTILS: Print the last lines of a container’s logs

docker logs --tail 100 [container_id] | less

Darkiros UTILS: Print the last lines of a container’s logs and follow

docker logs -f --tail 100 [container_id]

Darkiros UTILS: Create new network

docker network create [network_name]

Darkiros UTILS: List all networks

docker network ls

Darkiros UTILS: Builds, (re)creates, starts, and attaches to containers for all services

docker-compose up

Darkiros UTILS: Builds, (re)creates, starts, and dettaches to containers for all services

docker-compose up -d

Darkiros UTILS: Stops containers and removes containers, networks, volumes, and images created by up

docker-compose down

Documentation

Docker — Container Platform

Docker is the industry-standard container platform that enables developers to package applications and their dependencies into lightweight, portable containers that run consistently across any environment.

Core Architecture

Docker uses a client-server architecture:

  • Docker Daemon (dockerd): Background service managing containers, images, networks, and volumes
  • Docker CLI (docker): Command-line interface that communicates with the daemon via REST API
  • Docker Registry: Storage and distribution system for container images (default: Docker Hub)

Container Lifecycle

flowchart LR
    A[Dockerfile] -->|docker build| B[Image]
    B -->|docker push| C[Registry]
    C -->|docker pull| B
    B -->|docker run| D[Container]
    D -->|docker stop| E[Stopped]
    E -->|docker start| D
    E -->|docker rm| F[Removed]

Docker Compose

For multi-container applications, docker compose defines services, networks, and volumes in a YAML file:

# docker-compose.yml
version: "3.9"
services:
  web:
    image: nginx:alpine
    ports:
      - "80:80"
  database:
    image: postgres:15
    environment:
      POSTGRES_DB: myapp
      POSTGRES_PASSWORD: secret
    volumes:
      - db-data:/var/lib/postgresql/data
volumes:
  db-data:
# Start all services
docker compose up -d

# View logs
docker compose logs -f

# Tear down
docker compose down -v

Security Best Practices

  • Never run containers with --privileged in production
  • Use read-only root filesystems (--read-only)
  • Drop unnecessary Linux capabilities (--cap-drop ALL)
  • Scan images for vulnerabilities (docker scan or Trivy)
  • Use distroless or scratch base images to reduce attack surface

Related Tools

  • podman — Daemonless container engine (drop-in Docker replacement)
  • kubernetes — Container orchestration platform
  • docker-compose — Multi-container application definition

Related Tools

podmancontainerdnerdctl

References