A CLI for working with docker on OSX
Project description
osxdocker
A CLI for working with docker on OSX
Currently it only 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
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 details
Dev Install
# install dev dependencies
pipenv install --dev
# install osxdocker as symlink to avoid reinstall whenever code changes
pipenv run dev_install
# only runs from pipenv in dev
pipenv run osxdocker
Test pypi install
# install from test pypi, allow pull from non-test pypi for fire
pip3 install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple osxdocker
Dev tools
Deploy
https://github.com/takluyver/flit/ manages building and deploying
# build dist
pipenv run flit build
# publish to test pypi
pipenv run publish_test
# really publish
pipenv run publish
Tests
pipenv run tests
Linter
# to autoformat python code
pipenv run lint
# to sort imports
pipenv run isort -y
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.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86e69d26298e2eceff749538c5f2e3c631f385af64531fae0fefc1b2572d8623 |
|
MD5 | 2640e3b974052ea34c89b1c990c69320 |
|
BLAKE2b-256 | a7cc88f01829dcdd3277ae7cdb8850692ee807a83cd5cfbb928c0df759a7b017 |