Skip to content

Docker CE

Overview

Docker CE is an open-source containerization technology for building and containerizing your applications.


Deployment

Saltbox dependency.

sb install docker

Usage

docker

FAQ

Why does Saltbox use the Docker network "saltbox" instead of bridge?
  1. This keeps all Saltbox containers organized under one network
  2. the docker bridge network does not allow network aliases.

Role Defaults

Variables can be customized using the Inventory. (1)

  1. Example override

    docker_dns: ["item1", "item2"]
    

    Avoid overriding variables ending in _default

    When overriding variables that end in _default (like docker_docker_envs_default), you replace the entire default configuration. Future updates that add new default values will not be applied to your setup, potentially breaking functionality.

    Instead, use the corresponding _custom variable (like docker_docker_envs_custom) to add your changes. Custom values are merged with defaults, ensuring you receive updates.

docker_dns
# Format is ["8.8.8.8", "8.8.4.4"]
# Type: list
docker_dns: []
docker_config_custom
# YAML Dictionary that gets combined with the defaults and later converted to json
# Example of how to remove an option:
# docker_config_custom:
# log-opts: "{{ omit }}"
# Example of how to add options:
# docker_config_custom:
# debug: "true"
# Type: dict
docker_config_custom: {}
docker_cpus_default
# CPU and Memory defaults
# Type: string
docker_cpus_default: ""
docker_memory_default
# Type: string
docker_memory_default: ""
docker_skip_start_during_meta_tag
# Skip Container startup during core, saltbox, mediabox or feederbox
# If the kernel has been updated and a reboot will happen
# Type: bool (true/false)
docker_skip_start_during_meta_tag: "{{ saltbox_auto_reboot }}"
docker_create_image_prune
# Toggles pruning of dangling images after container creation.
# Type: bool (true/false)
docker_create_image_prune: true
docker_create_image_prune_delay
# Type: bool (true/false)
docker_create_image_prune_delay: true
docker_create_image_prune_delay_timeout
# Type: int
docker_create_image_prune_delay_timeout: 10

The role allocates the first available port within the inclusive low and high bounds and retains it while it remains within those bounds and free of conflicts. Override an instance's bounds to change the allowed range; set both bounds to the same value to require one exact port, including for an existing assignment.

Existing assignments are stored in /opt/saltbox/port-assignments.json. On each role run, a saved port outside the current bounds or in conflict is reassigned within the current bounds, with a warning showing the old port, new port, and reason. These bounds also apply to ports manually changed in that file. If no port is available within the bounds, allocation fails without changing the registry.

docker_dns_port_low_bound
# Type: int
docker_dns_port_low_bound: 8190
docker_dns_port_high_bound
# Type: int
docker_dns_port_high_bound: 8280