Skip to content
anchor

GitHub Action

Docker context over SSH

v2.1.3 Latest version

Docker context over SSH

anchor

Docker context over SSH

Create a docker context over SSH authentication

Installation

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

              

- name: Docker context over SSH

uses: amirmarmul/docker-context-ssh-action@v2.1.3

Learn more about this action in amirmarmul/docker-context-ssh-action

Choose a version

GitHub release GitHub marketplace

About

Github Action for creating docker context over SSH authentication.

Input variables

See action.yml for more detailed information.

  • ssh-host - ssh host
  • ssh-port - ssh port, default 22
  • ssh-username - ssh username
  • ssh-private-key - content of ssh private key. ex raw content of ~/.ssh/id_rsa
  • ssh-passphrase - passphrase for ssh private key. no default.
  • ssh-socket - ssh socket, default /tmp/ssh-auth.sock
  • context-name - name of docker context. default: remote
  • context-use - indicate which this context is set as docker current context. default: false

Usage

on: [push]

jobs:
  docker_context_over_ssh_job: 
    runs-on: ubuntu-latest
    steps:
      - name: Set up docker context over SSH authentication
        uses: amirmarmul/docker-context-ssh-action@v1
        with:
          ssh-host: ${{ secrets.SSH_HOST }}
          ssh-username: ${{ secrets.SSH_USERNAME }}
          ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
          ssh-passphrase: ${{ secrets.SSH_PASSPHRASE }}
      
      - name: Inspect docker context  
        run: docker context ls -q