Setup the connection to remote Docker daemon via SSH.
Adds private key, known hosts and ssh configuration file.
Optionally setups the DOCKER_HOST
environment variable.
See action.yml for more detailed information.
host
- Docker daemon hostuser
- SSH userkey
- Content of SSH private key
Optional:
port
- SSH port, default to22
key_path
- Path to the SSH private key, default to/home/runner/.ssh/id_rsa
set_docker_host_env
- Whether theDOCKER_HOST
env var should be updated, default totrue
docker-host
- The value ofDOCKER_HOST
in the format ofssh://<user>@<host>:<port>
Default - Configure env var DOCKER_HOST
in every subsequent steps
to point to the Docker daemon host.
- uses: pcjun97/action-setup-docker-host-ssh@v1
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
user: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
- run: |
docker ps
Alternatively, set up the environment variable with per step basis.
- uses: pcjun97/action-setup-docker-host-ssh@v1
id: docker-ssh
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT }}
user: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
set_docker_host_env: 'false'
- run: |
docker ps
env:
DOCKER_HOST: ${{ steps.docker-ssh.outputs.docker-host }}