1. ホーム
  2. ドッカー

コンテナ起動時に、ポートIPが占有されている_ポートがすでに割り当てられている

2022-03-03 18:08:03
<パス

帰属表示付きで再掲載 http://www.paraller.com 原文組版のアドレス クリックすると読みやすくなります 2 root root 4096 Aug 28 11:54 checkpoints -rw-r--r-- 1 root root 3844 Aug 28 18:30 config.v2.json -rw-r--r-- 1 root root 1350 Aug 28 18:30 hostconfig.json -rw-r--r-- 1 root root 1350 Aug 28 18:30 hostconfig.json -RW-RW-RW- 1 root root 1350 Aug 28 18:30 hostconfig.json -RW-RW- 1 root root 1340 Aug 28 18:40 hostconfig. json - rw-r--r-- 1 root root 13 Aug 28 18:30 hostname -rw-r--r-- 1 root root 230 Aug 28 18:30 hosts -rw-r--r-- 1 root root 237 Aug 28 18:30 resolv.conf -rw-r--r-- 1 root root 71 Aug 28 18:30 resolv.conf.hash drwxrwxrwt 2 root 40 Aug 28 18:30 shm ````?

このディレクトリの下にコンテナの設定情報がありますので、hostconfig.jsonを編集してください。

{"Binds":["/etc/localtime:/etc/localtime:ro","/etc/timezone:/etc/timezone:ro","/mnt/docker-data /logstash/y-activity:/usr/src/app/logs:rw"],"ContainerIDFile":"","LogConfig":{"Type": "json-file","Config":{}},"NetworkMode":"default","PortBindings":{"3909/tcp& quot;:[{"HostIp":"10.170.48.177","HostPort":"3909"}]},"RestartPolicy":{" Name":"","MaximumRetryCount":0},"AutoRemove":false,"VolumeDriver":""," VolumesFrom":[],"CapAdd":null,"CapDrop":null,"Dns":[],"DnsOptions":[],"DnsSearch ":[],"ExtraHosts":null,"GroupAdd":null,"IpcMode":"","Cgroup":""," "Links":["common_nginx2_1:nginxProxy"],"OomScoreAdj":0,"PidMode":""," Privileged":false,"PublishAllPorts":false,"ReadonlyRootfs":false,"SecurityOpt":null," UTSMode":"","UsernsMode":"","ShmSize":67108864,"Runtime":"runc"," quot;ConsoleSize":[0,0],"Isolation"::"","CpuShares":0,"Memory":0,"NanoCpus": 0,"CgroupParent":"","BlkioWeight":0,"BlkioWeightDevice":null,"BlkioDeviceReadBps" ;:null,"BlkioDeviceWriteBps":null,"BlkioDeviceReadIOps":null,"BlkioDeviceWriteIOps":null," CpuPeriod":0,"CpuQuota":0,"CpuRealtimePeriod":0,"CpuRealtimeRuntime":0,"CpusetCpus":" quot;","CpusetMems":"","Devices":null,"DeviceCgroupRules":null,"DiskQuota": 0,"KernelMemory":0,"MemoryReservation":0,"MemorySwap":0,"MemorySwappiness":-1," OomKillDisable":false,"PidsLimit":0,"Ulimits":null,"CpuCount":0,"CpuPercent":0," IOMaximumIOps":0,"IOMaximumBandwidth":0}

適切なIPとポート番号を削除し、docker start mongoを再度起動します。

最終的にうまくいかない場合は、service docker stopしかありません。