User Tools

Site Tools


docker:containers:assign_a_hostname_to_the_container

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
docker:containers:assign_a_hostname_to_the_container [2020/05/13 08:28] peterdocker:containers:assign_a_hostname_to_the_container [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Docker - Containers - Assign a hostname to the container ====== ====== Docker - Containers - Assign a hostname to the container ======
- 
-The value supplied to the **--hostname** command is set inside **/etc/hostname** and **/etc/hosts** inside the container. 
- 
-Consequently, it appears in the command prompt. 
- 
-It plays a role in configuring container DNS and can be helpful while in the learning stages of a multi-container setup. 
- 
-It is not easy to access from outside the container, but it will appear in the container's log files, and when those files are written to a volume independent of the host, it can make it easier to identify the container. 
  
 <code bash> <code bash>
Line 20: Line 12:
  
  
-While **<nowiki>--name</nowiki>** and **<nowiki>--hostname</nowiki>** are both useful for identification of containers, sometimes, it's not about naming the container at all Rather, it'about having a container clean up after itself without having to remember to do it yourself.+<WRAP info> 
 +**NOTE:**  **<nowiki>--name</nowiki>** and **<nowiki>--hostname</nowiki>** are both useful for identification of containers
 + 
 +The value supplied to the **--hostname** command is set inside **/etc/hostname** and **/etc/hosts** inside the container. 
 + 
 +Consequently, it appears in the command prompt of the container. 
 + 
 +It plays a role in configuring container DNS. 
 + 
 +It is not easy to access from outside the containerbut it will appear in the container'log files, and when those files are written to a volume independent of the host, it can make it easier to identify the container. 
 +</WRAP> 
  
docker/containers/assign_a_hostname_to_the_container.1589358483.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki