芭蕾舞女演员-无法建立Docker映像

时间:2018-08-16 17:11:27

标签: ballerina

使用此版本安装芭蕾舞女演员后,您好

https://product-dist.ballerina.io/nightly/0.981.1-SNAPSHOT/ballerina-platform-linux-installer-x64-0.981.1-SNAPSHOT.rpm

我无法从我的芭蕾舞演员代码生成docker映像:

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

endpoint http:Listener PessoasEP {
port: 9095,
secureSocket: {
    keyStore: {
        path: "${ballerina.home}/bre/security/ballerinaKeystore.p12",
        password: "ballerina"
    }
}
};

@http:ServiceConfig {
basePath: "/"
}
@docker:Config {
registry:"devcamp2018",
name:"pessoas-docker",
tag:"1.0"
}
service getPessoas bind PessoasEP {
@http:ResourceConfig {
    methods: ["GET"],
    path: "/pessoas"
}    
getPessoas(endpoint caller, http:Request req) {
    http:Response res = new;

    json p2 = [
        {
            fname: "Joao",
            lname: "Silva"
        },{
            fname: "Roberto",
            lname: "Monteiro"
        }
    ];

    res.setPayload(p2);
    caller->respond(res) but {
        error e => log:printError("Error in responding ", err = e) 
    };
}
}

除了安装芭蕾舞演员外,还有其他要做的事情吗?

1 个答案:

答案 0 :(得分:1)

您只需安装BallerinaDocker。然后执行以下命令以使用docker image创建芭蕾舞女演员可执行文件。

注意:使用给定的代码示例创建一个sample.bal文件

$ ballerina run sample.bal

输出如下:

Compiling source
    sample.bal

Generating executable
    sample.balx
        @docker                  - complete 3/3 

        Run the following command to start a Docker container:
        docker run -d devcamp2018/pessoas-docker:1.0

可以通过执行$ docker images

列出创建的Docker映像。
REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE
devcamp2018/pessoas-docker           1.0                 586bedf394bc        About an hour ago   127MB