Search code examples
dockerdocker-composedocker-swarmdocker-machine

Docker compose not available on docker swarm cluster


Question 1: I am new to docker swarm, I created a docker swarm cluster on my local machine and SSH in to it. To my surprise docker-compose was NOT installed inside the manager node. Is that normal ? Is there any workaround to get the docker compose up and running on swarm manager node ?

Question 2: how do I manage to get all my code inside manager node. Let’s say I have my source code on a director. If I want to move that inside my docker swarm manager node. How can I do that ?


Solution

  • It is common for docker-compose to not be installed on servers compared to docker-desktop-clients which come bundled with docker-compose and other tools. You have to install it to use it on your local machine. https://docs.docker.com/compose/install/

    Although you can use your installation of docker-compose to work against the docker-daemon on your local machine by setting DOCKER_HOST

    https://docs.docker.com/engine/reference/commandline/cli/#environment-variables

    You can copy your source-code onto your local-machine via scp https://linuxize.com/post/how-to-use-scp-command-to-securely-transfer-files/

    But you would rather build images and deploy onto your local-machine.