Docker Compose vs Docker Stack

They are very similar, but if you are upgrading from docker compose to docker stack, you may need to modify your existing docker compose yaml file. From what I noticed, here are the obvious pain points

  • No build. If you have build and args, you will need to do that outside of the yaml file. Docker stack expects to see image.
  • No container_name. If you have other services (e.g. nginx) that depend on container_name, you will need to use some workarounds.

Since there are too many sample docker compose yaml files out there, chances are that you will need to modify them if you want to stick with docker stack. I spent too much time playing with nginx, caddy, and traefik, all had some unexpected weird issues with docker stack. The moment I switched back to docker compose, all issues are gone. I will stick with docker compose for now.

ref:
https://stackoverflow.com/questions/46485066/docker-compose-set-container-name-for-stacks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s