Package: wdocker
wdockerGithub|BitBucket|PyPI|Travis-CIwdocker is a simple little solution to manage your docker image(s)
and container(s) without having to remember and type long lists of
optional arguments to docker commands. There are far more sophisticated
soultions for managing Docker container environments likeDeckingorDocker composeand I advise to use them for setting up environments
of multiple containers.Reasons for using this docker wrapper called wdocker may be:it does not need an (extra) configfileit does not make any assumptions about your docker environmentit is very flexible and scriptableDependenciesPython2.7 or 3.2 and higherDockerInstallingInstalling (from the Python Package Index):sudopipinstall--upgradewdockerInstalling (development version):gitclonegit://github.com/babab/wdocker.gitcdwdockersudomakeinstallUn-installing:pipuninstallwdockerWriting commands in your DockerfileWhen wdocker runs, it parses the Dockerfile in the current directory and
tries to find variables and commands. These are both defined by using a
‘special’ comment, that begins with#wd#.Defining a variable:#wd# <var> = <value>Defining a command (commands are very much like shell aliases):#wd# <command>: <shell command>Expanding a variable in another variable or command:#wd# somevar = {variable}
#wd# somecommand: {variable}Dockerfile examplesYou must define your own commands and it don’t even have to be docker
commands, so you can get as creative as you would like.A very basic Dockerfile might look like this:#wd# name = example_basic
#wd# build: docker build -t {name} .
#wd# run: docker run -it --name {name} {name}FROMdebian:latestCMDwatchpsauxIt is perfectly possible to combine variables and commands, like in this
example:# wdocker vars:#wd# docker = docker
#wd# name = combined
#wd# build = {docker} build -t {name} .
#wd# run = {docker} run -it --name {name} {name}# wdocker commands:#wd# build: {build}
#wd# run: {run}
#wd# up: {build} && {run}FROMdebian:latestCMDwatchpsauxUsing wdocker to run commandsIt you just run wdocker without any arguments, it will show a usage
message with the possible commands that you have defined in you
Dockerfile with the variables expanded. This can be used to review any
command before actually executing it.To also show variables and internal commands, run wdocker with either-h,-helpor--help.The usage message for the last Dockerfile example looks like this:Usage: wdocker [<command> | -help]

Commands:
  build     docker build -t combined .
  run       docker run -it --name combined combined
  up        docker build -t combined . && docker run -it --name combined combinedAnd the full message with wdocker -help looks like this:Usage: wdocker [<command> | -help]

Internal commands:
  -help, -h, --help      show full usage info and vars
  -version               show version info
  -print-var <variable>  print value of <variable>

Variables:
  docker    = docker
  name      = combined
  build     = docker build -t combined .
  run       = docker run -it --name combined combined

Commands:
  build     docker build -t combined .
  run       docker run -it --name combined combined
  up        docker build -t combined . && docker run -it --name combined combinedThis means you can proceed to execute eitherwdocker build,wdocker runorwdocker up.Running testsTesting is done with nose. To install nose and run tests in a Python
virtualenv for example, do the following (pyvenv is available since
Python 3.3):pyvenv.virtualenvsource.virtualenv/bin/activatepipinstall-rrequirements-dev.txtnosetests-vTests are run automatically for each commit and/or pull request byTravis-CI.Bugs, Issues and EnhancementsFeel free to use the issues, forking and/or pull requests mechanisms ofGithuborBitbucketto submit bugs, ideas or enhancements.Licensewdocker is released under an ISC license, which is functionally
equivalent to the simplified BSD and MIT/Expat licenses, with language
that was deemed unnecessary by the Berne convention removed.Copyright (c) 2015  Benjamin Althues <benjamin@babab.nl>Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.Change LogAll notable changes to wdocker will be documented here. The project
adheres toSemantic Versioning.0.2.0 - 2015-10-02AddedThis CHANGELOGInternal command-versionfor displaying version informationSupport for full shell commands likedocker foo exec ip addr | grep 172FixedInternal commands not displaying with -help when there is no DockerfileHandle error when variable is called but not defined0.1.0 - 2015-09-26AddedInitial release