Monday, 22 January 2024

docker default hostname for container in docker0(docker default network)

 In the same way, a container's hostname defaults to be the container's ID in Docker. You can override the hostname using --hostname. When connecting to an existing network using docker network connect, you can use the --alias flag to specify an additional network alias for the container on that network.


https://docs.docker.com/network/#:~:text=In%20the%20same%20way%2C%20a,the%20container%20on%20that%20network.


docker ps

containerID ... containerName(folder-serviceName-number)

docker inspect containerID


   "MacAddress": "",

            "Networks": {

                "backend_default": {

                    "IPAMConfig": null,

                    "Links": null,

                    "Aliases": [

                        "containerName(folder-serviceName-number)",

                        "serviceName",

                        "containerID "

                    ],


No comments:

Post a Comment