docker run --hostname myhost alpine

Category: Docker

docker run --hostname myhost alpine

Set the container's hostname to myhost

Sets the container's internal hostname to 'myhost'. Programs inside the container see this as their hostname.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.