Each container needs to have a Dockerfile in order for docker-compose to work. Under /path/to/repo/chapters/14, you will see the following directory structure, where a directory exists for each type of container to be built:
├── docker-compose.yml
├── config_svr
│ └── Dockerfile
├── mongos
│ └── Dockerfile
├── shard_1
│ └── Dockerfile
├── shard_2
│ └── Dockerfile
└── shard_3
└── Dockerfile
Each Dockerfile is identical and contains instructions for the source Docker image, as well as information regarding what additional packages to install.
An example of this is as follows:
FROM mongo
RUN \
apt-get update && \
apt-get -y upgrade && \
apt-get -y install inetutils...