简体   繁体   English

从主机到容器的容器端口映射

[英]Containerd port mapping from host to container

I am new to containerd and trying to run a simple application with Containerd.我是containerd的新手,正在尝试使用 Containerd 运行一个简单的应用程序。 I am using ctr to access images, containers and tasks.我正在使用ctr来访问图像、容器和任务。

In case of a Docker I used to give command as docker run -p 8085:8085 imageId:version如果是 Docker 我曾经给出命令docker run -p 8085:8085 imageId:version

This mapped my host to the container and gave a way for me to expose APIS from container to the host and outside world.这将我的主机映射到容器,并为我提供了一种将 APIS 从容器公开到主机和外部世界的方法。

But I am not sure how to do this using ctr in containerd.但我不确定如何在 containerd 中使用 ctr 来做到这一点。 Also kindly let me know if it is possible or not.也请让我知道是否可能。

Thanks in advance.提前致谢。

You cannot map from container to outside work using the ctr command.您不能使用 ctr 命令从容器到外部工作 map。 Instead, use nerdctl ( https://github.com/containerd/nerdctl ) as it has the same docker CLI functionality.相反,请使用 nerdctl ( https://github.com/containerd/nerdctl ),因为它具有相同的 docker CLI 功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM