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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dmocker-0.0.2.tar.gz.
File metadata
- Download URL: dmocker-0.0.2.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6059200b00ff9734334f22f5b96af7cb814561c67941b8f735dd7e90f5da4acc
|
|
| MD5 |
cf82ad35ad505ef1531c61016408d05c
|
|
| BLAKE2b-256 |
f618ba521978555cb02cae42732a20692d2d64c2865b09e13da8b6d096a53a26
|
File details
Details for the file dmocker-0.0.2-py3-none-any.whl.
File metadata
- Download URL: dmocker-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b74ee8389a057f73184838792adf53b658d16abcbaca35dea19c569559bd76e6
|
|
| MD5 |
e46033def938b231e181433b6132ffb6
|
|
| BLAKE2b-256 |
d69d9c3c56140e8823efad9f2dab388ec5380d51f595b435ca3f622ea08f78e4
|