Created
February 11, 2020 12:56
-
-
Save kawanet/a44493c0c3942b4b8f5d768f5a304564 to your computer and use it in GitHub Desktop.
Dockerコンテナ内で個別のホスト名を設定する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker="$(egrep ':/docker/[0-9a-f]+$' /proc/self/cgroup | head -1)" | |
docker="${docker##*/}" | |
hostname "docker-${docker:0:8}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment