使用此版本安装芭蕾舞女演员后,您好
我无法从我的芭蕾舞演员代码生成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)
};
}
}
除了安装芭蕾舞演员外,还有其他要做的事情吗?
答案 0 :(得分:1)
您只需安装Ballerina和Docker。然后执行以下命令以使用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
REPOSITORY TAG IMAGE ID CREATED SIZE
devcamp2018/pessoas-docker 1.0 586bedf394bc About an hour ago 127MB