Skip to main content

Build Status Documentation Status PyPI PyPI - License Code style: black

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

clear_log_example

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:

  1. 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')
    
  2. 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.

multiple_container_error

Developer notes

See docs/source/dev.md

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)

Source distribution for osxdocker 0.1.3
File Size Uploaded
osxdocker-0.1.3.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for osxdocker 0.1.3
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page