Thursday, 28 December 2023

restart docker service ubuntu and inspect docker ip used for bridge and container and docker dameon.json location

 https://stackoverflow.com/questions/26137834/starting-docker-as-daemon-on-ubuntu

sudo service docker restart


https://stackoverflow.com/questions/45161508/how-to-get-docker0-ip-address-platform-independently


for bridge

docker0 network interface is associated with the default docker network bridge.
You can access info about it with the docker network inspect bridge.
You can use the --format option to get specific value:

$ docker network inspect bridge --format='{{json .IPAM.Config}}'
[{"Subnet":"172.17.0.0/16","Gateway":"172.17.0.1"}]


for container 
https://stackoverflow.com/questions/17157721/how-to-get-a-docker-containers-ip-address-from-the-host

docker inspect \
  -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id

// get container 
docker ps
https://stackoverflow.com/questions/43689271/wheres-dockers-daemon-json-missing
/etc/docker/daemon.json

No comments:

Post a Comment