one container with multiple images

I'm following the docker-compose activity :

"Build Services with Docker Compose" In here two  base images(ghost blog:1.7 alpine and mysql:5.7)  were specified in the docker-compose file and upon composing, two containers were created.(one for mysql and one for ghost blog). Is there a way to get the two services(blog and mysql) in the same container?

  • post-author-pic
    John M

    If you create a base image, and then install both you can then commit and push to Docker Hub. There may be one in there already. Best practice is however to run one service per container. Then you can put both containers in one Kubernetes pod. This ensures you can patch and maintain each container easily, and also automate their health through the container orchestration. two packages in one container eliminates the isolation benefits and is a throwback to virtualization. If your containers are lightweight and portable, then they will scale better ina  cloud cluster. They also are quicker to vacate and re-instantiate with rolling upgrades or simple outages. Hope this helps - John

Looking For Team Training?

Learn More