Skip to content
anchor

GitHub Action

Docker run command remote host

v0.0.1 Pre-release

Docker run command remote host

anchor

Docker run command remote host

Run docker command on the remote Docker host by creating Docker context using SSH connection

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Docker run command remote host

uses: 38ri581oq480/[email protected]

Learn more about this action in 38ri581oq480/docker-run-command-remote-host-action

Choose a version

About

GitHub Action to run docker command on the remote Docker host by creating Docker context using SSH connection

Example usage 👀

Get list of images on remote Docker host

- name: List images on remote Docker host
  uses: 38ri581oq480/[email protected]
  with:
    ssh_host_key: ${{ secrets.DOCKER_HOST_SSH_HOST_KEY }}
    ssh_private_key: ${{ secrets.DOCKER_HOST_SSH_PRIVATE_KEY }}
    docker_host: my-docker-host.com
    docker_command: image ls

Deploy to remote Docker Swarm

- name: Deploy to Docker swarm
  uses: 38ri581oq480/[email protected]
  with:
    ssh_host_key: ${{ secrets.DOCKER_HOST_SSH_HOST_KEY }}
    ssh_private_key: ${{ secrets.DOCKER_HOST_SSH_PRIVATE_KEY }}
    docker_host: my-swarm-manager-node.com
    docker_command: stack deploy -c docker-compose.yml my-stack-name