This wraps the Docker CLI so that it establishes saner defaults for my own needs.
-
docker run
will set to logging to none and-it
by default -
docker rm
is forced -
docker ls
maps todocker ps
-
docker ps
will actually calldocker inspect
then render the data using github.com/jedib0t/go-pretty.- Primarily because I want to know WHEN the bloody container started,
- how long it took to start rather than about a minute ago.
- Show ports only if I am not running in service mode
-
docker service restart
maps todocker service update --force
-
docker service ls
shows only relavent columns- drop
:latest
if that's the image tag - use github.com/jedib0t/go-pretty to render the table
-
--down
to list services that are not fully up
- drop
-
docker service env
shows the environment variables -
docker service ps
without the service list will do all services- if primary is running and is desired to be running, don't bother showing the others
-
docker ptag
to tag and push image in one command-
-p
to add support for generating a patch tag
-
-
docker service push <service> <image>
replaces the image of the service if image is not provided it pulls and then does the update to ensure it is the latest copy. It will also add--with-registry-auth
as appropriate -
docker use <context>
maps todocker context use
-
docker context use
allowsdocker context use <target>
which uses the target rather than the context name.- automatically create the context if it does not exist
-
docker service --help
should calldocker service --help
but append the extra commands -
docker service inspect
shows data- gets rid of the previous spec
- use network names rather than the IDs
-
docker du
shows disk usage stats in JSON -
docker stat
runsdocker stats --no-stream
with sane columns (i.e. no ID) -
docker stats
runs with sane columns (i.e. no ID) and hopefully less flashing -
docker context create <name> <dockerhost>
maps todocker context create <name> --docker "host=<dockerhost>"
-
docker context create <dockerhost>
maps todocker context create <host portion of dockerhost> --docker "host=<dockerhost>"
-
Special handling for ridiculously long image names, specifically "ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib"
- Use Cobra to manage the CLI
- Use the CLI for the most part until they have a package that would handle
DOCKER_HOST
- output will be in JSON like the CLI because there's no yaml mappings in the Docker types