在Ballerina Quick Tour页面上,有一个关于在docker容器中部署先前创建的集成微服务(应该发送推文)的示例。
但是,文档的这一部分并没有描述如何打包" twitter.toml" (容器内的身份验证详细信息)。因此,它不像在容器中部署时那样工作。
如何解决这个问题?
答案 0 :(得分:4)
那里缺少复制配置文件的部分。尝试添加@docker:CopyFiles
注释。以下对我有用:
@docker:Config {
registry:"registry.hub.docker.com",
name:"helloballerina",
tag:"v1.0"
}
@docker:CopyFiles {
files: [{source: "./twitter.toml", target: "/opt/twitter.toml", isBallerinaConf: true}]
}
endpoint http:Listener tweetEP {
port: 9090
};
在这里,我选择使用/opt
作为放置配置文件的目录。您可以在容器中指定所需的路径。 isBallerinaConf
字段用于指定要复制的文件是否为配置文件。
有关详细信息,请参阅ballerinax/docker
包的API docs。
答案 1 :(得分:2)
芭蕾舞女演员Quick-tour页面现已更新相关信息。