Fast Deploying Systems With Docker

Install Play Framework in Docker

First of all, we will introduce the play framework. Play is an open source web application framework, written in Scala and Java and it was divided into two different incompatible branches, 1.X (adopted Java) and 2.X (adopted Scala). The main advantage of play framework is it follows model-view-controller(MVC) pattern which let program maintain web application easily. No mattern which branches you used, first of all, we need to install Java into our docker container.

Due to container being a light os system, we need to install some useful tools, such as vim, to help us to manipulate the system.

Install VIM

$ sudo apt-get install git wget vim ssh

Install Java OpenJDK

1. Updating APT package

$  sudo apt-get update

2. Install Java default JDK

$ sudo apt-get install default-jdk

Due to container being a light os system, we need to install some useful tool to help us to manipulate the system.

Install Java Oracle JDK

1.Install necessary package

Before installing java, you need to install python to let your system can use add-apt-repository commands. First of all, you need to use the commands:

$ sudo apt-get install software-properties-common

Then use the following commands:

$ sudo apt-get install python-software-properties

2. Install Java oracle

First of all, you need to add WebUPD8 repository

$ sudo add-apt-repository ppa:webupd8team/java

Then use following commands to install Java.

$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer

Then, you install java in your docker images.

Install Play Framework

First of all, you need to go to playframework's download page. Next, we use unzip package to decompress the file.

After getting playframework package, we need to add the $PATH to the environment variable.

$ export /{play-version}:$PATH

Finally, we need to create a play project:

$  play new myFirstPlay

Then use the commands to run this project

$ play run