salt.states.docker

States to manage Docker containers, images, volumes, and networks

Changed in version 2017.7.0: The legacy Docker state and execution module have been removed, and the new modules (formerly called dockerng have taken their places).

Important

As of the 2017.7.0 release, the states in this module have been separated into the following four state modules:

The reason for this change was to make states and requisites more clear. For example, imagine this SLS:

myuser/appimage:
  docker.image_present:
    - sls: docker.images.appimage

myapp:
  docker.running:
    - image: myuser/appimage
    - require:
      - docker: myuser/appimage

The new syntax would be:

myuser/appimage:
  docker_image.present:
    - sls: docker.images.appimage

myapp:
  docker_container.running:
    - image: myuser/appimage
    - require:
      - docker_image: myuser/appimage

This is similar to how Salt handles MySQL, MongoDB, Zabbix, and other cases where the same execution module is used to manage several different kinds of objects (users, databases, roles, etc.).

The old syntax will continue to work until the Fluorine release of Salt.

salt.states.docker.absent(name, **kwargs)

Deprecated since version 2017.7.0: This state has been moved to docker_container.absent.

salt.states.docker.image_absent(**kwargs)

Deprecated since version 2017.7.0: This state has been moved to docker_image.absent.

salt.states.docker.image_present(name, **kwargs)

Deprecated since version 2017.7.0: This state has been moved to docker_image.present.

salt.states.docker.mod_watch(name, sfun=None, **kwargs)
salt.states.docker.network_absent(name, **kwargs)

Deprecated since version 2017.7.0: This state has been moved to docker_network.absent.

salt.states.docker.network_present(name, **kwargs)

Deprecated since version 2017.7.0: This state has been moved to docker_network.present.

salt.states.docker.running(name, **kwargs)

Deprecated since version 2017.7.0: This state has been moved to docker_container.running.

salt.states.docker.stopped(**kwargs)

Deprecated since version 2017.7.0: This state has been moved to docker_container.stopped.

salt.states.docker.volume_absent(name, driver=None)

Deprecated since version 2017.7.0: This state has been moved to docker_volume.absent.

salt.states.docker.volume_present(name, driver=None, driver_opts=None, force=False)

Deprecated since version 2017.7.0: This state has been moved to docker_volume.present.