Module : docker

Module Overview

This module offers an annotation based docker extension implementation for ballerina.

Annotation Usage Sample:

import ballerina/http;
import ballerina/log;
import ballerina/docker;

@docker:Expose{}
listener http:Listener helloWorldEP = new(9090);

@http:ServiceConfig {
      basePath: "/helloWorld"
}
@docker:Config {
    registry: "docker.abc.com",
    name: "helloworld",
    tag: "v1.0"
}
service helloWorld on helloWorldEP {
    resource function sayHello(http:Caller caller, http:Request request) {
        http:Response response = new;
        response.setTextPayload("Hello, World from service helloWorld ! \n");
        var responseResult = caller->respond(response);
        if (responseResult is error) {
            log:printError("error responding back to client.", err = responseResult);
        }
    }
}

Records

DockerConfiguration Docker annotation configuration.
ExposeConfig Expose ports for docker.
FileConfig External file type for docker.
FileConfigs External File configurations for docker.

Annotations

Config

@docker:Config annotation to configure docker artifact generation.

CopyFiles

@docker:CopyFile annotation to copy external files to docker image.

Expose

@docker:Expose annotation to expose ballerina ports.