A CLI for working with docker on OSX
Project description
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
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
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 osxdocker-0.1.3.tar.gz.
File metadata
- Download URL: osxdocker-0.1.3.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.8 CPython/3.8.3 Darwin/19.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22494190cb8053c806ae19b02c6ec998a59b2a959076f4bd84bc7d0b2fad81c3
|
|
| MD5 |
a9fb255c9479869551294c6c72d8309b
|
|
| BLAKE2b-256 |
97404793a93bf53da7d396b5dc096fe7aa360759907a7e44cbad5d76af73c4d8
|
File details
Details for the file osxdocker-0.1.3-py3-none-any.whl.
File metadata
- Download URL: osxdocker-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.8 CPython/3.8.3 Darwin/19.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
def096b3a5258c9825b5bee56e8016e011b889227955895fe83489276bdbbb72
|
|
| MD5 |
47c9dc9aa1695cdd19482b4556ad26ce
|
|
| BLAKE2b-256 |
201d0ec2563885807e7277b2a198bb744e87864282fbb7af626d90e51d27e8ad
|