Search code examples
dockergitlabcontainerscontinuous-deploymentgitlab-ci-runner

Issue commands from a gitlab-runner inside docker container


I have a machine with multiple docker containers for a project that I am developing and I just set up a new docker container running Gitlab-Runner inside it.

I need to run a few commands on all the other docker-containers whenever a commit is issued, is there anyway for the runner inside the Gitlab-Runner to access the other containers and tell them to execute commands or even restart them?

We currently don't use SSH keys to access this server that has all the docker containers, we use username and password.


Solution

  • The safe way (and easier than with passwords too) is start using SSH keys and access containers over network. Or at least issue commands to host over SSH from gitlab-runner.

    Also, SOF seach returned this: manage containers from another container, docker Looks legit.