Technical Writing | Google Developers

httping

http/https の疎通確認をワン・コマンドで。便利。

$ httping til.toshimaru.net
PING til.toshimaru.net:80 (/):
connected to 185.199.111.153:80 (645 bytes), seq=0 time=182.28 ms
connected to 185.199.111.153:80 (642 bytes), seq=1 time= 11.11 ms
--- http://til.toshimaru.net/ ping statistics ---
2 connects, 2 ok, 0.00% failed, time 1935ms
round-trip min/avg/max = 11.1/96.7/182.3 ms
$ httping https://til.toshimaru.net
Auto enabling SSL due to https-URL
PING til.toshimaru.net:443 (/):
connected to 185.199.111.153:443 (645 bytes), seq=0 time=172.78 ms
connected to 185.199.111.153:443 (642 bytes), seq=1 time= 24.86 ms
connected to 185.199.111.153:443 (642 bytes), seq=2 time= 19.08 ms
connected to 185.199.111.153:443 (642 bytes), seq=3 time= 54.27 ms
--- https://til.toshimaru.net/ ping statistics ---
4 connects, 4 ok, 0.00% failed, time 3407ms
round-trip min/avg/max = 19.1/67.7/172.8 ms

コンテナへ環境変数を設定

Environment variables in Compose | Docker Documentation

docker-compose.yml にこんな感じでセット。

web:
  environment:
    - DEBUG=1

環境変数をホストからコンテナに引き継ぐ場合。

web:
  environment:
    - DEBUG

.env ファイルを使って受け渡す場合。

$ cat .env
TAG=v1.5

$ cat docker-compose.yml
services:
  web:
    image: "webapp:${TAG}"