1

我创建了一个带有图像的 pod 来发布一个nextjs有很多手动修改的站点

我最初创建了 pod 和镜像,镜像端口 3000 映射到主机端口 3000 使用这个单行:

podman run -dt --pod new:alpinenpmpod -p 3000:3000 alpine

在创建 pod 和映像之后,如何将映像的端口 3000 映射到主机端口 80?

输出podman pod inspect alpinenpmpod

{
    "Id": "c1abdf9e53b7cf13f232d0f4946a4806261086432fbd5109e38eb7cf8610a98e",
    "Name": "alpinenpmpod",
    "Created": "2020-08-28T12:25:07.442784426-07:00",
    "State": "Stopped",
    "Hostname": "alpinenpmpod",
    "CreateCgroup": true,
    "CgroupParent": "/libpod_parent",
    "CgroupPath": "/libpod_parent/c1abdf9e53b7cf13f232d0f4946a4806261086432fbd5109e38eb7cf8610a98e",
    "CreateInfra": true,
    "InfraContainerID": "745662de8d1a508d68ea12ab8c764899dcf752aa10d48aafbd026e1794b50d2b",
    "InfraConfig": {
        "PortBindings": {
            "3000/tcp": [
                {
                    "HostIp": "",
                    "HostPort": "3000"
                }
            ]
        },
        "HostNetwork": false,
        "StaticIP": "",
        "StaticMAC": null,
        "NoManageResolvConf": false,
        "DNSServer": null,
        "DNSSearch": null,
        "DNSOption": null,
        "NoManageHosts": false,
        "HostAdd": null,
        "Networks": null
    },
    "NumContainers": 2,
    "Containers": [
        {
            "Id": "419dec5dea94d7afd1d1d8d3484857bdeac04b553820c59aab14d41674472bc9",
            "Name": "vigorous_brattain",
            "State": "exited"
        },
        {
            "Id": "745662de8d1a508d68ea12ab8c764899dcf752aa10d48aafbd026e1794b50d2b",
            "Name": "c1abdf9e53b7-infra",
            "State": "configured"
        }
    ]
}

另外,有没有办法可以将这个 pod 连同它的图像一起导出,以便我可以在其他地方运行它们?

4

0 回答 0