Building the Image and Creating Docker Job

This lesson shows how to upload the tarball and create a docker job for angular.

Setup Environment for the Course #

Uploading Docker #

Navigate to the Docker Container section on our course edit page.

Click on 'Change Docker File (Beta)' button.
Click on 'Change Docker File (Beta)' button.

Click on the Change Docker File (Beta) button and select the tarball angular.tar.gz from your local PC where you saved it.

Click on the Save button to start the image building process.

Building the Image #

Building an image will take a few minutes. If your image is built successfully you will see the following message:

Image was successfully built.
Image was successfully built.

However, if your build has failed the following message will be displayed:

Image build failed.
Image build failed.

In case the build fails, check your Dockerfile, the error will lie there. The best way to debug is to have a look at the Docker Build logs.

Docker build logs
Docker build logs

Docker Jobs #

In this step, we will revise how to create docker jobs, but more specifically keeping angular and Live VM in mind.

widget

Set the fields as:

Select Docker Job Type

Select the type of docker job.

Live

After selecting Live the docker job input form will change as shown below:

widget

Job Name

This acts as an id to your docker job which is necessary.

angular

Input File Name

In Live VM, this field is optional. However, you can name it anything. Let’s put foo here.

foo

Run Script

This script is compiled after the start script and it is compulsory. It basically runs your code every time the Run button is clicked (have a look at the SPA widget at the end of this lesson).

cp -r /usercode/* /educative/angular_demo/ && cd /educative/angular_demo

Application Port

3000

Start Script

The last script to compile when we click the RUN button in the SPA widget and it is necessary. This script only runs once at the start when your app’s terminal is being initiated.

cp -r /usercode/* /educative/angular_demo/ && cd /educative/angular_demo && ng serve --port 3000 --host 0.0.0.0 --disable-host-check

The final stage will look like so:

widget

Now, we just have to configure the code in SPA to use the docker job we just created.