ServerAvatarDocs
Servers

Docker

Create and remove the Docker networks, volumes and database containers of a container server, read the server's Docker limits and save credentials for private registries.

On a server that runs containers (a Docker stack), Docker shows the networks, volumes and database containers that the server's Docker applications use. Open Docker in the server's sidebar. Central shows and changes Docker on the server itself.

The page has three parts: Networks, Volumes and Databases. Under the page title a row of Docker limits shows what the server allows. Credentials for private image registries have their own page, Docker registries, covered at the end of this page.

On a server that does not host containers (for example a LEMP server) the page says "Not a container server": "This server doesn't host containers, so it has no Docker networks or volumes."

Networks

Containers on the same network reach each other by name. Networks lists the networks of your own with their Name and the Containers attached. Under the name a network says whose it is: "app's own network", "Joined by sites" (the applications set to join it) or "No application has joined it yet." Docker's built-in networks cannot be changed.

Create a network

  1. In Networks, select Create network.
  2. Enter a Name, for example network-name. Use letters, numbers, dots, dashes and underscores, and start with a letter or number.
  3. Select Create network. You see "Network name created."

Remove a network

  1. Open Actions for network name and select Remove.
  2. Confirm Remove network name? "Nothing is attached to it. Containers that later expect it will fail to start until it's recreated."
  3. You see "Network name removed."

A network cannot be removed while containers are attached ("Containers are still attached to this network. Stop or detach them first.") or while applications are set to join it ("These applications are set to join this network: sites. Change their network first — removing it now would stop them starting.").

Volumes

Data in a volume survives the container being rebuilt. Volumes lists each volume with its Name, its Size and what it is Used by (an application's data, a container, or "Not in use"). Create one, then mount it on an application's Container page (see Containers). Copy path on the server copies where it lives on the server.

Create a volume

  1. In Volumes, select Create volume.
  2. Enter a Name, for example volume-name, with the same rule as a network name.
  3. Select Create volume. You see "Volume name created."

Remove a volume

  1. Open Actions for volume name and select Remove.
  2. Confirm Remove volume name? "This deletes the data inside it. Nothing is using it right now, but a stopped container may still expect it."
  3. You see "Volume name removed."

A volume cannot be removed while a running container uses it ("A running container is using this volume. Removing it would delete data something is still writing to.") or while applications mount it ("These applications mount this volume: sites. Remove the mount from them first — deleting it now destroys the data they keep in it.").

Database containers

Databases lists the database containers on the server. They are containers your applications reach over a Docker network. Each row shows its Engine and version, From containers (the host name and port a container on the same network uses, and the network, or "on no network") and From the server (its port on 127.0.0.1, for connecting from the server itself).

Create a database

  1. In Databases, select Create database.
  2. Enter a Name, for example shop-db. Use letters, numbers, dots, dashes and underscores, up to 63 characters. It is also the database's host name on the network.
  3. Choose the Engine and Version from the lists the server offers.
  4. Choose a Network (optional). Put the database on an application's network so the application can reach it by name. Without one the row says "on no network".
  5. Set a CPU limit (optional), a number of cores such as 1 or 0.5, up to the most CPUs per container the server allows.
  6. Set a Memory limit (optional), a size with a unit such as 512m or 2g. If you leave it empty the server's default database memory is used.
  7. Select Create database. You see "Database name created."

Show a database's passwords

  1. Open Actions for database name and select Show passwords.
  2. Read the Password and Root password. "Read from the server now; the server logs each read." Use Copy password to copy one.

Only people who can manage Docker can read passwords.

Delete a database

  1. Open Actions for database name and select Remove.
  2. Confirm Delete database name? "The container is removed. Applications using it lose their database." The confirm button is Remove.
  3. To remove its data too, tick Also delete its data ("Deletes its volume too. This can't be undone."). Without it the data stays in its volume.
  4. You see "Database name deleted."

Docker limits

Under the page title, Docker limits shows what the server allows: Most CPUs per container, Default memory and Default database memory. A limit shows only when the server reports it. The limits are read-only here.

Docker registries

A server needs a registry credential to pull a private container image. Open Docker registries in the server's sidebar. Public images need nothing here. Have your registry username and an access token ready, not your account password.

Add a registry

  1. Select Add registry.
  2. Choose Where is the image hosted?: Docker Hub, GitHub Container Registry, GitLab Container Registry or Other or self-hosted registry. The form then says what to use for that registry (for example for Docker Hub a personal access token with Read access and your Docker ID as the username; for GitHub Container Registry a classic personal access token with read:packages; for GitLab a deploy token with read_registry).
  3. Enter a Name, which is how the credential is listed in ServerAvatar. For Other or self-hosted registry also enter the Registry address: the host on its own, with no https://, no namespace and no repository. Add a port if the registry uses one. Docker Hub and GitHub Container Registry fill the address in for you. GitLab starts with registry.gitlab.com, which you can change.
  4. Enter the Username and the Access token.
  5. Save. You see "name was added."

A registry that issues short-lived credentials (such as AWS ECR, whose last twelve hours) will authenticate now and start failing once the token expires, because ServerAvatar does not refresh it.

Test, edit or delete a credential

  • Select Test connection on the credential's row. You see "name accepted this username and token." or why it failed: "The registry refused this username and token.", "The registry could not be reached from this server." The status shows Connected, Failed or Not tested yet.
  • Open Actions for name and select Edit to change it. Leave the token empty to keep the stored token; type a new one to replace it. You see "name was saved."
  • Open Actions for name and select Remove, then confirm Delete name? The credential is deleted from this server. Applications that use it are not deleted and keep running, but their next pull will be anonymous and fails if the image is private.

Each credential shows how many applications use it (No applications, "1 application"…). Choose a credential on the create form or on an application's Container page to pull a private image.

Limits

  • Network and volume names: start with a letter or number, then letters, numbers, ., - and _, up to 128 characters.
  • Database name: up to 63 characters, same characters.
  • Database memory limit: a number with an optional unit b, k, m or g.
  • Registry Name up to 100 characters; Registry address and Username up to 255; Access token up to 4096; all on one line.
  • A network or volume that is in use cannot be removed.

Who can do this

  • Seeing Docker needs View on Docker (server.docker). Creating and removing networks, volumes and databases, and reading database passwords, need Manage. Without it the page says "Your role does not include Docker with Manage access. Ask an administrator to grant it."
  • Docker registries has its own permission, Docker Registries (server.integrations.registry): View lists the credentials, Manage adds, edits, tests and deletes them. Without it: "Your role does not include Registry with Manage access. Ask an administrator to grant it."
  • Docker is not available to Control Panel customers.

Common errors

  • Not a container server. The server has no Docker stack.
  • This server hosts no containers. (Docker registries) Registry credentials are for pulling container images.
  • Start with a letter or number, then use only letters, numbers, dots, dashes and underscores. (a name)
  • Use a size with a unit, like 512m or 2g. (memory limit)
  • Use a number of cores, like 1 or 0.5. (CPU limit)
  • The registry refused this username and token. Check the username and use an access token.

On this page