使用docker-client api将图像推送到docker注册表 [英] Pushing images to docker registry using docker-client api
问题描述
在探索docker-client api(java)的同时,建立与运行在vm上的docker守护程序的连接到底需要什么证书。
While exploring docker-client api (java) what certificates are exactly required for setting up connection to the docker daemon running on a vm.
我发现的代码在线:
{
// Create a client based on DOCKER_HOST and DOCKER_CERT_PATH env vars
final DockerClient docker = DefaultDockerClient.fromEnv().build();
// Pull an image
docker.pull("busybox");
}
上述示例的链接位于: https://github.com/spotify/docker-client
The link to above example is available at : https://github.com/spotify/docker-client
我打算做的是访问在我的主节点上运行的docker-daemon(通过magnum api部署)并将Java应用程序docker-image推送到注册表中,以便我可以使用这些映像在集群上创建pod。
What I intend to do is access docker-daemon running on my master node(deployed through magnum api) and push my java applications docker-image onto the registry so that I can create pods on my cluster using these images.
我不知道还需要做些什么,因为我是新来的。
I am not sure what more needs to be done as I am new to this.
推荐答案
也许您也可以简单地使用臂架核心API ,这是一个简单的Java库,不需要安装任何 docker
即可构建+推送图片!
Perhaps that you could also simply use Jib core APIs which is a simple Java library that doesn't need any docker
installed to build + push an image!
阅读此Google博客帖子以了解更多信息。
这篇关于使用docker-client api将图像推送到docker注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!