Menu

Running mia-tools by using Docker

For the latest release now a Docker image is now available. This makes running mia-tools of the latest stable release on non-linux operating systems easy,

In order to run the tools by using this image, Docker must be installed accordingly.

Running mia-tools via Docker on Windows

On MS Windows, the disk on which the data is located that you want to process needs to be enabled for sharing.

With this in place, any mia tool, e.g. to run binarize by using mia-2dimagefilter type the following commands into powershell:

$path= Convert-Path . 
docker run -w /home/mia -v ${path}:/home/mia --rm `
    gerddie/mia-tools:2.4.4 `
    mia-2dimagefilter -i someinput.png -o someoutput.png binarize:min=30

The input and output path must all be relative to and below the current working directory. For directory delimiters you must use / as the strings are passed literal, and the docker image is running a lightweight Ubuntu/Linux installation. Also, you should avoid spaces in directory names,

If you want to convert the above command into a powershell script, be aware that fro running these scripts you have to change the execution policy for running scripts and sign the script (I wouldn't recommend to set the policy to Unrestricted). The script would then look like this:

$path= Convert-Path . 
docker run -w /home/mia -v ${path}:/home/mia -u mia --rm `
    gerddie/mia-tools:2.4.4 $args

Running mia-tools on Unix-like operating systems

On Unix like systems with a working Docker installations the script to run any mia comand line tool is

docker run -w /home/mia \
                      -v $(pwd):/home/mia \
                      -u mia --rm \
                      gerddie/mia-tools:2.4.4 $*

The same limitations for file locations and no-whitespace in file and directoriy names apply.

Happy image processing!

Posted by Gert Wollny 2017-03-08

Log in to post a comment.