Simple command interface to manage multiple Docker container
Project description
portmgr
portmgr is a wrapper around docker-compose that allows running typical docker-compose commands recursively. Additionally, it shortens commands to a single letter.
Let's say you have organized your compose files like this, you just add a dckrsub.yml
in each parent folder:
docker/ ├── dckrsub.yml ├── reverse-proxy/ │ └── docker-compose.yml ├── storage │ ├── dckrsub.yml │ ├── nextcloud/ │ │ └── docker-compose.yml │ └── immich/ │ └── docker-compose.yml └── scripts
Each dckrsub.yml
has a list of subdirectories, which portmgr should decend into.
For example, the dckrsub.yml
in docker/
might look like this:
- reverse-proxy
- storage
And the dckrsub.yml
in docker/storage/
like this:
- nextcloud
- immich
Now, if you run portmgr u
in docker/
it will run docker compose up -d
in reverse-proxy/
, storage/nextcloud/
and storage/immich/
.
portmgr starts from the current directory, so when running it in docker/storage/
, it will run docker compose
only in nextcloud/
and immich/
. You can also use it in a directory with a docker-compose.yml
as a shortener for docker-compose commands.
Commands
The following commands are available. The respective docker-compose commands are in brackets.
u Create and start containers (up)
p Pull images (pull)
s Stop services (stop)
d Stop and remove containers (down)
l Show container logs (logs)
a Run shell in container (exec -it <service> sh)
b Build images (build)
c List containers (ps)
t List processes in containers (top)
r Build and push to registry (build, push)
v Scan container images for vulnerabilities
You combine multiple commands. For example portmgr dul
, runs docker compose with down
, up
and logs
, thus stopping, removing and starting all containers and then showing the logs.
Installation
sudo pip install portmgr
Or build it from source (here using the latest commit on master branch)
sudo pip install https://github.com/Craeckie/portmgr.git
Tipps
If you use portmgr a lot like me, you might want to shorten it to one letter. For bash, you can add alias p='portmgr'
to ~/.bashrc
. For fish-shell you can add abbr p portmgr
to ~/.config/fish/config.fish
.
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
File details
Details for the file portmgr-1.6.4.tar.gz
.
File metadata
- Download URL: portmgr-1.6.4.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1435a765f916d1b444f4ce077e99b631e92221ac9dab510a94484741029c456f |
|
MD5 | 3f51794ab9405d2d2ad2295012b74295 |
|
BLAKE2b-256 | 27a108c0a475f56e3275323cd3f694a0627b7b5d7fbe1702c75c844b6bb23e66 |
File details
Details for the file portmgr-1.6.4-py3-none-any.whl
.
File metadata
- Download URL: portmgr-1.6.4-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b70a1fb2c4297a5983036c4a2d2d3ea4a61334d43fb2a549c10765a0f6581b0 |
|
MD5 | 9f21434cc9ef4666f5c55b7328118ef6 |
|
BLAKE2b-256 | a1ad3b9689c43fb31c614bf02ec699f84cba54ba15004fd7322f3a08ec3c51d7 |