A CLI for working with docker on OSX
Project description
osxdocker
A CLI for working with docker on OSX :apple: :snake:
Currently it just handles docker logs, because I found it annoying starting up a screen session to get to the docker vm every time I wanted to clear logs. :man_shrugging:
See: https://stackoverflow.com/questions/42527291/clear-logs-in-native-docker-on-mac
Install
# python3 only
pip3 install osxdocker
Dependencies
Assumes you have docker
and screen
installed. If you don't, you can easily install them through brew. e.g.
brew cask install docker
brew install screen
Usage
# clear logs
osxdocker clear_log $some_container_name
# list available commands and flags
osxdocker
This cli uses https://github.com/google/python-fire
Check out the docs for more details on usage, setting up bash completion, etc.
Also worth noting:
- Because the package uses fire, it can be imported like a normal python package. e.g.
from osxdocker.docker_logs import DockerLogs DockerLogs().log_path('foo')
- This cli doesn't support
--version
due to a quirk with fire.osxdocker version # works fine osxdocker --version # won't work
Edge cases and gotchas
Container names are unique, but containers are filtered by regex, so you can still run into issues.
e.g. You have two containers, named foo and foo_too.
osxdocker cat_log foo
will fail because it matches foo and foo_too.
osxdocker cat_log ^foo$
will work because it matches foo exactly.
Developer notes
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
Built Distribution
Hashes for osxdocker-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed9e5f5fea22742f7a2ac89b22041db4dcb5f2b400e32e0ab01b2287c33dc26b |
|
MD5 | f7cfd1e047aeafb09ef712a8917d9bc1 |
|
BLAKE2b-256 | b2cc1b872aa2aeeaa021c7ade3656ab4f1c352479c191c2ab984eb85a3a215de |