How do I use docker and docker-compose

Goal

Build Bind service with Docker and auto startup it using docker-compose on Ubuntu

Environment

  • Ubuntu 14.04.5 LTS Server
  • docker-compose 1.11.2
  • docker 17.03.0-ce

About docker-compose

Create docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
mkdir -p ~/bind
cat >> ~/bind/docker-compose.yml << EOF
pichuang-dns:
image: sameersbn/bind:latest
dns: 127.0.0.1
environment:
- ROOT_PASSWORD=pichuang
ports:
- 192.168.101.1:10000:10000
- 192.168.101.1:53:53/udp
volumes:
- /srv/docker/dns:/data
EOF

Poke Me