So far I built two images. A database image and a web server with an app deployed on it.
I am reading different terms and concepts and super confused on how should i deliver this to my consumers as a solution. The terms like compose, swarm, docker-machine to create vm etc. are understood individually.
My trouble is I do not know what should be the right strategy to deliver my two image solution to consumer which makes it easiest to use for them. Please advise.
If you’re comfortable with everything essentially being public, one approach:
Use a standard database image from Docker Hub; don’t roll your own.
Build a standalone Docker image with whatever language runtime you need and your application baked into it. Publish it to Docker Hub.
Create a small GitHub repository containing a README.md file and a docker-compose.yml file that references the two images above.
Then users will need to clone the GitHub repository, or at least download the docker-compose.yml file, but then will be able to just run docker-compose up to get the two-container application running.
As the application author, you shouldn’t care whether the application is running on native Docker on Linux, or a Docker Machine VM, or a Docker Machine remotely managed system, or a Docker Swarm cluster, or a Kubernetes cluster, or a Nomad cluster (the last couple of options aren’t really directly compatible with Docker Compose though).
If using Docker >=1.13.0 as well, you can deploy Compose >=3.0 files natively with docker stack deploy -c docker-compose.yml stack.
That’d be my suggestion: Get clients on an installation of Docker compatible with that, give them the Compose file, and have them create a docker stack from it.
I have question here. a docker compose up do the same thing. I mean can bring up all the services volumes etc. then how it is different from docker stack ? sorry allow my dumb questions
docker-compose (https://github.com/docker/compose) is a Python program which existed before any support for “Compose files” (stacks) was merged into the Docker Engine (which is very recent, Compose has been around for years). docker stack deploy is very recent “swarm mode” functionality that uses the same file format (Compose >=3.0) but is natively supported in the Docker client and daemon (written in Go).
So, it’s somewhat the case that something which evolved in an external program layered on top of Docker has started to become officially integrated into Docker itself.