Overview

Skill Level: Beginner

Learn how to run a Spring Cloud Task locally from the command line

Ingredients

Step-by-step

  1. Connect to IBM Cloud using IBM Cloud CLI

    05-step01-0001-1

  2. Configure IBM Cloud CLI dev environment

    Go to the MySimpleTask project directory.

    [Optional] Delete previous dev environment setting, if you have already run “ibmcloud dev enable” command before.

    05-step02-0001-1

    Run the dev enabled command.

    05-step02-0002

     

    05-step02-0003

  3. Build the DevOps tools docker image

    05-step03-0001-1

  4. Update the Dockerfile of the Spring Cloud Task application docker image

    View the content of the Dockerfile of your application docker image. Observe the line that you need to change to point to the project jar file under the “target” directory which you have previously built.

    05-step04-0001

    Use your favorite text editor to update the Dockerfile. The example below shows how you can do that using a single “sed” command.

    05-step04-0002

     

     

  5. Run the Spring Cloud Task application docker image

    05-step05-0001

    Observe the hello message printed as a result of running the application in the docker image.

Join The Discussion