[Docker] Compose file에서 /etc/hosts 추가하기
by 스뎅(thDeng) onDocker Compose를 사용하면서 /etc/hosts
파일에 호스트를 추가하고 싶을 때는 extra_hosts
에 추가하면 된다.
services:
redis-cluster:
image: grokzen/redis-cluster:6.2.1
environment:
IP: '0.0.0.0' # https://github.com/Grokzen/docker-redis-cluster#important-for-mac-users
ports:
- '7000-7005:7000-7005' # The cluster is 6 redis instances running with 3 master & 3 slaves, one slave for each master. They run on ports 7000 to 7005.
volumes:
- './redis/redis-cluster.tmpl:/redis-conf/redis-cluster.tmpl'
extra_hosts:
- 'my-redis:127.0.0.1'