Tuesday, 11 October 2016

Jolie now available on Docker

Jolie is now available also on Docker, a container tool for deploying microservices. Using the Jolie image for Docker allows for trying out or installing Jolie in production faster, by using the Docker tool. More information about Docker can be found at http://www.docker.com.

To install a Jolie docker container, follow these steps:
  • Install Docker (if not already installed)
  • Run the following command for pulling the Jolie Docker image:

    docker pull jolielang/jolie1.6.0beta1
  • Create a container starting from the downloaded image, by adding a local volume where the Jolie files should be stored:

    docker run -it -v /your-host-folder-path:/your-container-path --name CONTAINERNAME jolielang/jolie1.6.0beta
    • -it : starts the container with a command shell enabled
    • --name CONTAINERNAME : gives a name to the container
    • -v /your-host-folder-path:/your-container-foldercreate an internal folder  /your-container-folder mapped to folder /your-host-folder-path in the host machine which will be used for sharing files between the container and the hosting machine. Thanks to this option, it is possible to edit Jolie files from the host machine preferred editor and then running them inside the container.

    Once the container is started, it is possible to run Jolie from inside the container instance shell with the usual command:

    jolie your_file.ol

Note that you can open several shells in your running container, by using following command from the host:

docker exec -it CONTAINERNAME bash

Wanna try Jolie out? Use the Docker container with Jolie examples!

For those who are interested in running some of the examples discussed in the documentation of the Jolie website, it is possible to pull the following Docker image instead of the basic one:

docker pull jolielang/jolie-examples

In the image, the folder /examples contains the whole set of examples. The examples can also be  downloaded separately from this git repository: https://github.com/jolie/examples.

No comments:

Post a Comment