Skip to main content

Remote Docker control

Project description

Welcome to dmocker!

Dmocker is a small terminal tool to interact with remote Docker containers. The use case of this tool is when you have Docker containers on multiple remote servers and don't use large solutions to monitor and interact with them. Dmocker allows to execute different commands on the remote devices simultaneously, saving time on manually established connections.

Currently, the tool has just a few functions:

  • list Docker containers on remote servers;
  • show logs from the specific container on the remote server.

Behind the scene dmocker uses paramiko library to establish ssh connection with remote servers. To avoid putting the password every time when use dmocker, it's better to create a key pair and send the public key on each remote device that is expected to be used with this tool:

ssh-keygen -t ed25519 -f {filename} -C {username}
ssh-copy-id -i {filename} username@remote_host
/usr/bin/ssh-add -K {filename}

Also, for each remote device it's better to create a placeholder in ~/.ssh/config file:

Host server1
    HostName 192.168.1.X
    User username1
Host server2
    HostName 192.168.1.X
    User username2

Now ssh connection may be established with much shorter command:

ssh server1
ssh server2

Hence, dmocker also can be used with this simplified ssh parameters:

dmocker server1 -t ps

Examples

List containers running on the server

dmocker server

List containers running on multiple servers

dmocker server1 server2... serverN

List containers running on multiple servers

dmocker server1 server2... serverN -t ps

List all containers on multiple servers

dmocker server1 server2... serverN -t ps a

List containers running on multiple servers, filtered by container_name_filter

dmocker server1 server2... serverN -n container_name_filter

Show last 10 logs from the container

dmocker server -t logs container_id

Show last 20 logs from the container

dmocker server -t logs container_id 20

Show last 10 logs from the container and follow

dmocker server -t logs container_id f

Show last 20 logs from the container and follow

dmocker server -t logs container_id 20 f

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dmocker-0.0.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dmocker-0.0.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file dmocker-0.0.1.tar.gz.

File metadata

  • Download URL: dmocker-0.0.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.7

File hashes

Hashes for dmocker-0.0.1.tar.gz
Algorithm Hash digest
SHA256 39cd0a8ee40592e23ae32dc76a4cae04ae1bb0c8c45be22d66f9d9cb80b20354
MD5 ca0cb8cfbac6d9cd4e810cac20cd0c3a
BLAKE2b-256 433d2b4398271e909cc311a7f5abde5527217431bf9e0a308a87b7e08f70e2be

See more details on using hashes here.

File details

Details for the file dmocker-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: dmocker-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.7

File hashes

Hashes for dmocker-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0476b7d75fb17e5d8f6bd2f3557b9ff6216a72a9fd2f8c686793073242aa5551
MD5 4744205885a6ed8aab97718c8f9d4336
BLAKE2b-256 7c897bbf4910ae694c8f5fb9b2963918d302a6a4efb57dcdf9962dacecc6c276

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page