Deploying agents in Docker

You can use the Visual Studio Code editor to deploy and run the agent in Docker.

Before you begin

Make sure to start the Docker client.

Building the Docker image

  1. Run the following command from agent-sdk-managed-implementation location in the terminal:
    gradle buildDockerImage (if you configured Gradle globally in your system) 
    (or)   
    ./gradlew buildDockerImage 

    buildDockerImage builds a Docker image with the default image tag name. The default docker image tag that is specified in the build.gradle file is agent-managed-sdk:latest.

  2. Verify whether the agent-managed-sdk:latest image is listed in the docker images by using the following command:
    docker images 

    To rename the tag, specify the following command from agent-sdk-managed-implementation location in the terminal:

    gradle buildDockerImage -Ptag=<new_tag_name>
    (or) 
    ./gradlew buildDockerImage -Ptag=<new_tag_name> 

    The new image tag is created with the specified name.

Starting the Docker image

  1. In the Visual Studio Code editor, open docker-compose from agent-sdk-<version>-with-implementation-samples\samples\deployment

    The .env and docker-compose.yml files include properties that are outlined in the application.properties file.

  2. Specify the value for each property.

    If you replaced the default Docker image name, make sure to update the DOCKER_IMAGE property with the new name.

  3. Run the following command from the deployment location in the terminal:
    docker-compose up -d 

    The agent application starts. You can verify whether the runtime name that is specified in the .env file is listed on the Runtimes tab in the Catalog page in the UI.