Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

       2. Click on the icon for the Quickstart Terminal window to launch it from the Application/Docker folder.  Verify the installation by running the hello-world container.

        $docker - run hello-world

            If Quickstart Terminal startup script did not configure the shell correctly, you may get message “docker: cannot connect to the Docker daemon. Is the docker daemon running on this host?.”

...

The template-converter directory consists of one file (docker-compose.yml), and one sub-directory, example-server , with two files: Dockerfile and ImageMagick_convert.sh.

...

Step 4: Testing the example-server

  • Open another docker terminal

                  Open Kitematic, press button 'DOCKER CLI' in bottom-left corner

  • Change to the example-server directory:

...

  • Make sure the permission for ImageMagick_convert.sh is 755.

 $cd chmod  $chmod 755 ImageMagick_convert.sh

  • Build and launch the example software server with the converter

 $docker build –t -t example-server .

 $docker run --rm -t -i --link polyglotimageconverter_rabbitmq_1:rabbitmq example-server

...

  • Modify the MyTool_convert.sh  using any editor (e.g. vim). A simple example is shown below:

...

 

Code Block
languagebash
titleExample conversion script
linenumberstrue
#!/bin/sh

...


#ImageMagick (v6.5.2)

...


#image

...


#png bmp foobar

...


#jpg 

output_filename=$(basename "$2")

...


output_format="${output_filename##*.}"

...



#Output PGM files as ASCII
if [ "$output_format" = "pgm" ]; then

...


  convert "$1" -compress none "$2"

...


else
  convert "$1" "$2"

...


fi

Line 2 : Change ImageMagick to MyTool

...

  • 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