Cloud Formation : Docker Swarm Mode on AWS


April 2019


133 time


Question : How do you bind and access a volume in your docker-compose once you are inside Manager Instance created by Cloud Formation?

My Problem:

  • My docker-compose.yml file is such that I need to bind an external Django Project Code with the services/containers which will be created by the stack but Cloud Formation functions on EBS(Elastic Block Store) and EFS(Elastic File System) and I don't know to use them to put my project in them and get them accessed by the stack.

  • I have been practicing something on Docker Swarm since a week and now I want to deploy my docker-compose.yml on AWS using "Docker for AWS" Cloud Formation Stack Template.

  • I saw this tutorial and followed too but in my project, I am mainly facing issues when I have to bind volume.

  • In Cloud Formation for Docker for AWS when you ssh the manager instance the syntax is like: ssh -i [your-pem-key] [email protected][manager-instance-public-ip]

  • Now after getting into the manager what I did was I executed my docker-compose.yml in the same stack which was created early by Docker on AWS template by the syntax:

    docker stack deploy -c docker-compose.yml TestLab

    but as because my app needs code how to bind it with a volume.

  • I would like to say that -v mounts don't work here.

Links which I have already referred and discarded:


0 answers