osxdocker
A CLI for working with docker on OSX
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. 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
--versiondue 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
Metadata
Release files for osxdocker 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| osxdocker-0.1.3.tar.gz | 6.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| osxdocker-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.5 kB
Release files / osxdocker-0.1.3.tar.gz
| Download URL | osxdocker-0.1.3.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22494190cb8053c806ae19b02c6ec998a59b2a959076f4bd84bc7d0b2fad81c3
|
|
BLAKE2b-256 checksum How to use checksums |
97404793a93bf53da7d396b5dc096fe7aa360759907a7e44cbad5d76af73c4d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.8 CPython/3.8.3 Darwin/19.5.0
|
Release files / osxdocker-0.1.3-py3-none-any.whl
| Download URL | osxdocker-0.1.3-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
def096b3a5258c9825b5bee56e8016e011b889227955895fe83489276bdbbb72
|
|
BLAKE2b-256 checksum How to use checksums |
201d0ec2563885807e7277b2a198bb744e87864282fbb7af626d90e51d27e8ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.8 CPython/3.8.3 Darwin/19.5.0
|