dockerit

Command for docker things.
Installation
Head to the releases page and download the latest version for your system.
Features
Containers are deleted after the command has run.
Usage:
dockerit [image]
dockerit [image] [command]
dockerit [flags] [image] [command] -- [command flags]
Flags:
--entry Use the default entrypoint. If entry=0 you must provide one (default true)
-e, --env stringArray Set environment variables
-h, --help help for dockerit
--home Mount the home directory of the user
--me User override for the command, runs as current user
--port string Port mapping <host>:<container> eg. 8080:80
--pull Pull the docker image even if present
--pwd Mount the PWD into the container (and set as working directory /pwd)
--user string User override for the command
-v, --verbose verbose output
--version version infomation
Example usage
Output help infomation:
dockerit --help
Run an interactive shell in the latest php image:
dockerit php -- -a
Run an bash in the latest ubuntu image (overriding default point):
dockerit --entry=0 --user=root ubuntu bash
Run composer version 1 info in the current working directory as the current user with their home dir mounted and set as the composer home:
dockerit --me --pwd --home COMPOSER_HOME=~/.composer composer:1 info
Run nginx as the container user and expose it on port 8080:
dockerit --port=8080:80 nginx
Run git in the current working directory as the current user with their home dir mounted:
dockerit --me --pwd --home git config -- --list
Run a command in an image with verbose mode turned on:
dockerit --verbose [image] [command]
Development
Dependencies
go mod vendor
Run from source
There is a shortcut to help you:
./dev
Building
Built using https://github.com/laher/goxc and a Makefile
go get github.com/laher/goxc
Then build...
make build
If you want to build with a specific version number / name:
VERSION=0.0.0 make build
The build directory will be populated with the release.