Skip to content

Useful Docker Commands

Chaz Larson edited this page Apr 5, 2022 · 88 revisions

Docker Commands

Stop all docker containers

docker stop $(docker ps -a -q)

Start all docker containers

docker start $(docker ps -a -q)

Start all but one container (e.g. All docker containers except Watchtower)

docker start  $(comm -13 <(docker ps -a -q --filter="name=watchtower" | sort) <(docker ps -a -q | sort))

Remove all docker containers - once they are stopped (be careful)

docker rm $(docker ps -a -q)

Forcefully, Remove all docker containers (be careful)

docker rm -f $(docker ps -a -q)

Restart only the running containers

/opt/scripts/docker/restart_containers.sh

Docker Logs

Find the container name: docker ps -a

Live log (from the beginning of the log):

docker logs -follow <container_name>

Live log (from the last 10 lines of the log):

docker logs --follow --tail 100 <container_name>

Live log (from the last 10 lines of the log) - abbreviated:

docker logs -f --tail 100 <container_name>

Removing Docker Containers

Don't want a certain docker container? You can remove it with the follow steps.

Note: Certain docker containers are essential to Cloudbox (e.g. nginx-proxy, letsencrypt).

Via Command line:

  • Get a list of docker container's installed: docker ps -a
  • Remove the one you don't want (where <name> is replaced with the docker container's name): docker stop <name> && docker rm <name>

Via Portainer:

  • https://portainer.yourdomain.com
  • "Containers" --> make your selection --> "Remove"

Misc

Let's Encrypt

To display information on existing certificates:

docker exec letsencrypt /app/cert_status

To force renew certificates that need to be renewed:

docker exec letsencrypt /app/signal_le_service

To force renew all certifications:

docker exec letsencrypt /app/force_renew

Renew certificates alternative method [develop branch only]

If the previous method does not work or returns an error try

cb install letsencrypt,nginx-proxy 

Watchtower

Tool to automaticaly update Docker images and containers.

Note: We recommend you manually update the docker images and containers via their Ansible tags. Updating Docker containers with Watchtower has been known to cause data corruption. So use at your own risk.

docker start watchtower && docker logs -f watchtower

Wait 15 secs for it to finish updating all images except rutorrent (it ignores).. then:

docker stop watchtower

If no updates, stop anyway.

Basics

  1. Introduction
  2. Cloudbox Install Types
  3. Cloudbox Paths
  4. Accessing Cloudbox Apps

Prerequisites

  1. Overview
  2. Presumptions
  3. Server
  4. Domain Name
  5. Cloudflare
  6. Cloud Storage
  7. Plex / Emby - Account
  8. Usenet vs. BitTorrent

Install Cloudbox

Cloudbox
  1. Overview
  2. Dependencies (Choose only one of these)
  3. Settings
  4. Preinstall (Choose only one of these)
  5. SSH
  6. Ansible Vault
  7. Rclone
  8. Cloudbox (Choose only one of these)
  9. Application Setup
    1. NZBGet
    2. ruTorrent
    3. NZBHydra2
    4. Jackett
    5. Plex Media Server
    6. Plex Autoscan
    7. Sonarr
    8. Radarr
    9. Lidarr
    10. PlexPy (Tautulli)
    11. Ombi
    12. Portainer
    13. Organizr
  10. Next Steps

Install Feederbox / Mediabox

Feederbox (do this first)
  1. Overview
  2. Dependencies
  3. Settings
  4. Preinstall
  5. SSH
  6. Ansible Vault
  7. Rclone
  8. Feederbox (Choose only one of these)
  9. Application Setup
    1. NZBGet
    2. ruTorrent
    3. NZBHydra2
    4. Jackett
    5. Sonarr
    6. Radarr
    7. Lidarr
    8. Portainer
    9. Organizr
  10. Next Steps

Mediabox
  1. Overview
  2. Dependencies
  3. Settings
  4. Preinstall
  5. SSH
  6. Ansible Vault
  7. Rclone
  8. Mediabox (Choose only one of these)
  9. Application Setup
    1. Feeder Mount
    2. Plex Media Server
    3. Plex Autoscan
    4. PlexPy (Tautulli)
    5. Ombi
  10. Next Steps

Recommended Reading

Backup and Restore

More Information

Advanced Configuration

Experimental

Extras

Misc

Community-Submitted

See Community Wiki.

Reference

Troubleshooting

Links

Clone this wiki locally