...
- Modify the MyTool_conver.sh using any editor (e.g. vim). A simple example is shown below:
1 #!/bin/sh
2 #ImageMagick (v6.5.2)
3 #image
4 #png bmp foobar
5 #jpg
6
7 output_filename=$(basename "$2")
8 output_format="${output_filename##*.}"
9
10 #Output PGM files as ASCII
11 if [ "$output_format" = "pgm" ]; then
12 convert "$1" -compress none "$2"
13 else
14 convert "$1" "$2"
15 fi
Line 2 : Change ImageMagick to MyTool
Line 4 : Replace foobar with gif
Line 5: Add ico
Then save the file.
A detail document explaining how to write converter for any tool can be found here:
...
...
- Modify Dockerfile file using any editor (e.g. vim):
Line 11: Add MyTool to the .aliases.txt
Modify:
echo "ImageMagick" > /home/polyglot/polyglot/scripts/sh/.aliases.txt
To
echo "MyTool" > /home/polyglot/polyglot/scripts/sh/.aliases.txt
Line 15: Copy MyTool_convert.sh script to the script directory
COPY MyTool_convert.sh /home/polyglot/polyglot/scripts/sh/
Save the file
To build, launch and test the new converter, run the following command:
$docker build –t mytool .
$docker run --rm -t -i --link polyglot_rabbitmq_1:rabbitmq mytool