MacOS 执行screen tty提示screen is terminating
此文章为转载文章原文链接 https://blog.csdn.net/goldenpotatos/article/details/111779839问题描述Mac 系统需要动态修改 docker 容器参数时, 需要运行screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty但是显示[screen is terminating]解决方案docker run -it --privileged --pid=host justincormack/nsenter1 cd /var/lib/docker/containers && ls此时进入 justincormack/nsenter1 容器, 列出所有容器 ID, 根据所需容器 ID 进入文件夹修改暴露端口 config.v2.json关键字: ExposedPorts"ExposedPorts":{"80/tcp":{}}修改如下："ExposedPorts":{"80/tcp":{},"1234/tcp":{}}修改端口映射 hostconfig.json关键字: PortBindings"PortBindings":{"80/tcp":[{"HostIp":"","HostPort":"80"}]}修改如下:"PortBindings":{"80/tcp":[{"HostIp":"","HostPort":"8080"}],"1234/tcp":[{"HostIp":"","HostPort":"1234"}]}注意事项所有修改开始前必须停止目标容器所有修改完成后必须重新启动 Docker, 然后启动容器, 否则所有修改会被还原.查询容器 ID 命令 docker inspect {docker name} | grep Id