{"id":31642174,"url":"https://github.com/cssnr/docker-context-action","last_synced_at":"2026-04-18T00:31:56.786Z","repository":{"id":316993004,"uuid":"1065596838","full_name":"cssnr/docker-context-action","owner":"cssnr","description":"Set up a Docker Remote Context over SSH using Password or Keyfile Authentication","archived":false,"fork":false,"pushed_at":"2025-11-22T22:59:12.000Z","size":83,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-23T00:16:02.081Z","etag":null,"topics":["actions"],"latest_commit_sha":null,"homepage":"https://actions.cssnr.com/docker-context","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cssnr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"ko_fi":"cssnr"}},"created_at":"2025-09-28T03:32:40.000Z","updated_at":"2025-11-22T22:28:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"6e44a8ea-23c7-43b5-8fa0-5cbb211cadc4","html_url":"https://github.com/cssnr/docker-context-action","commit_stats":null,"previous_names":["cssnr/docker-context-action"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/cssnr/docker-context-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssnr%2Fdocker-context-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssnr%2Fdocker-context-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssnr%2Fdocker-context-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssnr%2Fdocker-context-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cssnr","download_url":"https://codeload.github.com/cssnr/docker-context-action/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cssnr%2Fdocker-context-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31951277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions"],"created_at":"2025-10-07T03:56:58.723Z","updated_at":"2026-04-18T00:31:56.775Z","avatar_url":"https://github.com/cssnr.png","language":"JavaScript","funding_links":["https://ko-fi.com/cssnr"],"categories":[],"sub_categories":[],"readme":"[![GitHub Tag Major](https://img.shields.io/github/v/tag/cssnr/docker-context-action?sort=semver\u0026filter=!v*.*\u0026logo=git\u0026logoColor=white\u0026labelColor=585858\u0026label=%20)](https://github.com/cssnr/docker-context-action/tags)\n[![GitHub Tag Minor](https://img.shields.io/github/v/tag/cssnr/docker-context-action?sort=semver\u0026filter=!v*.*.*\u0026logo=git\u0026logoColor=white\u0026labelColor=585858\u0026label=%20)](https://github.com/cssnr/docker-context-action/releases)\n[![GitHub Release Version](https://img.shields.io/github/v/release/cssnr/docker-context-action?logo=git\u0026logoColor=white\u0026labelColor=585858\u0026label=%20)](https://github.com/cssnr/docker-context-action/releases/latest)\n[![GitHub Dist Size](https://img.shields.io/github/size/cssnr/docker-context-action/dist%2Findex.js?logo=bookstack\u0026logoColor=white\u0026label=dist%20size)](https://github.com/cssnr/docker-context-action/blob/master/src)\n[![Workflow Release](https://img.shields.io/github/actions/workflow/status/cssnr/docker-context-action/release.yaml?logo=cachet\u0026label=release)](https://github.com/cssnr/docker-context-action/actions/workflows/release.yaml)\n[![Workflow Test](https://img.shields.io/github/actions/workflow/status/cssnr/docker-context-action/test.yaml?logo=cachet\u0026label=test)](https://github.com/cssnr/docker-context-action/actions/workflows/test.yaml)\n[![Workflow Lint](https://img.shields.io/github/actions/workflow/status/cssnr/docker-context-action/lint.yaml?logo=cachet\u0026label=lint)](https://github.com/cssnr/docker-context-action/actions/workflows/lint.yaml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=cssnr_docker-context-action\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=cssnr_docker-context-action)\n[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/docker-context-action?logo=github\u0026label=updated)](https://github.com/cssnr/docker-context-action/pulse)\n[![Codeberg Last Commit](https://img.shields.io/gitea/last-commit/cssnr/docker-context-action/master?gitea_url=https%3A%2F%2Fcodeberg.org%2F\u0026logo=codeberg\u0026logoColor=white\u0026label=updated)](https://codeberg.org/cssnr/docker-context-action)\n[![GitHub Repo Size](https://img.shields.io/github/repo-size/cssnr/docker-context-action?logo=bookstack\u0026logoColor=white\u0026label=repo%20size)](https://github.com/cssnr/docker-context-action?tab=readme-ov-file#readme)\n[![GitHub Top Language](https://img.shields.io/github/languages/top/cssnr/docker-context-action?logo=sharp\u0026logoColor=white)](https://github.com/cssnr/docker-context-action)\n[![GitHub Contributors](https://img.shields.io/github/contributors-anon/cssnr/docker-context-action?logo=github)](https://github.com/cssnr/docker-context-action/graphs/contributors)\n[![GitHub Discussions](https://img.shields.io/github/discussions/cssnr/docker-context-action?logo=github)](https://github.com/cssnr/docker-context-action/discussions)\n[![GitHub Forks](https://img.shields.io/github/forks/cssnr/docker-context-action?style=flat\u0026logo=github)](https://github.com/cssnr/docker-context-action/forks)\n[![GitHub Repo Stars](https://img.shields.io/github/stars/cssnr/docker-context-action?style=flat\u0026logo=github)](https://github.com/cssnr/docker-context-action/stargazers)\n[![GitHub Org Stars](https://img.shields.io/github/stars/cssnr?style=flat\u0026logo=github\u0026label=org%20stars)](https://cssnr.github.io/)\n[![Discord](https://img.shields.io/discord/899171661457293343?logo=discord\u0026logoColor=white\u0026label=discord\u0026color=7289da)](https://discord.gg/wXy6m2X8wY)\n[![Ko-fi](https://img.shields.io/badge/Ko--fi-72a5f2?logo=kofi\u0026label=support)](https://ko-fi.com/cssnr)\n\n# Docker SSH Context Action\n\n- [Features](#Features)\n- [Inputs](#Inputs)\n- [Examples](#Examples)\n- [Tags](#Tags)\n- [Support](#Support)\n- [Contributing](#Contributing)\n\nSet up a Remote Docker Context over SSH using Password or Keyfile Authentication.  \nThis allows all subsequent `docker` commands to run on the remote host ([context](https://docs.docker.com/engine/manage-resources/contexts/)).\n\n```yaml\nsteps:\n  - name: 'Docker Context'\n    uses: cssnr/docker-context-action@v1\n    with:\n      host: ${{ secrets.DOCKER_HOST }}\n      user: ${{ secrets.DOCKER_USER }}\n      port: 22 # 22 is the default value - optional\n      pass: ${{ secrets.DOCKER_PASS }} # or ssh_key - optional\n      ssh_key: ${{ secrets.DOCKER_SSH_KEY }} # or pass - optional\n\n  - name: 'Inspect Docker'\n    run: |\n      docker context ls\n      docker context inspect\n      docker info\n      docker ps\n```\n\n**Make sure to review the [Inputs](#Inputs).**\n\n_Stack Deploy: If you only need to deploy a swarm or compose stack use: [cssnr/stack-deploy-action](https://github.com/cssnr/stack-deploy-action)_  \n_Portainer Users: You can deploy directly to Portainer with: [cssnr/portainer-stack-deploy-action](https://github.com/cssnr/portainer-stack-deploy-action)_\n\n## Features\n\n- Configure SSH using keyfile or password: [src/ssh.sh](src/ssh.sh)\n- Creates and uses a remote docker context: [src/context.sh](src/context.sh)\n- Option to run Docker login for any registry: [src/login.sh](src/login.sh)\n- Clean up the authorized_keys file for password: [src/cleanup.sh](src/cleanup.sh)\n\nDon't see your feature here? Please help by submitting a [Feature Request](https://github.com/cssnr/docker-context-action/discussions/categories/feature-requests).\n\n## Inputs\n\n| Input\u0026nbsp;Name                              |     Default\u0026nbsp;Value     | Description\u0026nbsp;of\u0026nbsp;Input |\n| :------------------------------------------- | :------------------------: | :----------------------------- |\n| [host](#host)                                |         _Required_         | SSH Hostname or IP             |\n| `user`                                       |         _Required_         | SSH Username                   |\n| `port`                                       |            `22`            | SSH Port                       |\n| [pass](#passssh_key)                         | [or ssh_key](#passssh_key) | SSH Password                   |\n| [ssh_key](#passssh_key)                      |  [or pass](#passssh_key)   | SSH Key File                   |\n| [registry_user](#registry_userregistry_pass) |             -              | Registry Username              |\n| [registry_pass](#registry_userregistry_pass) |             -              | Registry Password              |\n| [registry_host](#registry_host)              |        `docker.io`         | Registry Host                  |\n| [token](#token)                              |       `github.token`       | Personal Access Token          |\n\nWith all inputs (not all required).\n\n```yaml\n- name: 'Docker Context'\n  uses: cssnr/docker-context-action@v1\n  with:\n    host: ${{ secrets.DOCKER_HOST }}\n    user: ${{ secrets.DOCKER_USER }}\n    port: 22 # 22 is default, you can remove or change this\n    pass: ${{ secrets.DOCKER_PASS }} # not needed with ssh_key\n    ssh_key: ${{ secrets.DOCKER_SSH_KEY }} # not needed with pass\n    registry_user: ${{ vars.GHCR_USER }}\n    registry_pass: ${{ secrets.GHCR_PASS }}\n    registry_host: 'ghcr.io'\n```\n\n**Make sure to check out the [Examples](#Examples).**\n\n---\n\n#### host\n\nThe hostname or IP address of the remote docker server.\n\nIf your hostname is behind a proxy like Cloudflare you will need to use the IP address.\n\n#### pass/ssh_key\n\nRequired to set up the SSH the connection. Provide a `pass` or `ssh_key` but not both.\n\nIf this was done in a previous step, omit these values to skip this step.\n\n#### registry_user/registry_pass\n\nOnly set these to run `docker login`.\n\nThis can also be run manually in another step.\n\n#### registry_host\n\nTo run `docker login` on another registry. Requires both `registry_user/registry_pass`.\n\nExample: `ghcr.io`.\n\n#### token\n\nThe `${{ github.token }}` / `{{ secrets.GITHUB_TOKEN }}` is automatically passed, there is no need to manually pass these!\n\nThis is only used to download the bin scripts from the GitHub API.\nYou can pass a PAT from your `secrets` if the default token does not work.\n\n## Examples\n\nExample workflow.\n\n```yaml\nsteps:\n  - name: 'Docker Context'\n    uses: cssnr/docker-context-action@v1\n    with:\n      host: ${{ secrets.DOCKER_HOST }}\n      user: ${{ secrets.DOCKER_USER }}\n      pass: ${{ secrets.DOCKER_PASS }}\n\n  - name: 'Stack Deploy'\n    run: docker stack deploy -c docker-compose.yaml --detach=false stack-name\n```\n\nFor more examples, you can check out other projects using this action:  \nhttps://github.com/cssnr/docker-context-action/network/dependents\n\n## Tags\n\nThe following rolling [tags](https://github.com/cssnr/docker-context-action/tags) are maintained.\n\n| Version\u0026nbsp;Tag                                                                                                                                                                                                           | Rolling | Bugs | Feat. |   Name    |  Target  | Example  |\n| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-----: | :--: | :---: | :-------: | :------: | :------- |\n| [![GitHub Tag Major](https://img.shields.io/github/v/tag/cssnr/docker-context-action?sort=semver\u0026filter=!v*.*\u0026style=for-the-badge\u0026label=%20\u0026color=44cc10)](https://github.com/cssnr/docker-context-action/releases/latest) |   ✅    |  ✅  |  ✅   | **Major** | `vN.x.x` | `vN`     |\n| [![GitHub Tag Minor](https://img.shields.io/github/v/tag/cssnr/docker-context-action?sort=semver\u0026filter=!v*.*.*\u0026style=for-the-badge\u0026label=%20\u0026color=blue)](https://github.com/cssnr/docker-context-action/releases/latest) |   ✅    |  ✅  |  ❌   | **Minor** | `vN.N.x` | `vN.N`   |\n| [![GitHub Release](https://img.shields.io/github/v/release/cssnr/docker-context-action?style=for-the-badge\u0026label=%20\u0026color=red)](https://github.com/cssnr/docker-context-action/releases/latest)                           |   ❌    |  ❌  |  ❌   | **Micro** | `vN.N.N` | `vN.N.N` |\n\nYou can view the release notes for each version on the [releases](https://github.com/cssnr/docker-context-action/releases) page.\n\nThe **Major** tag is recommended. It is the most up-to-date and always backwards compatible.\nBreaking changes would result in a **Major** version bump. At a minimum you should use a **Minor** tag.\n\n# Support\n\nFor general help or to request a feature, see:\n\n- Q\u0026A Discussion: https://github.com/cssnr/docker-context-action/discussions/categories/q-a\n- Request a Feature: https://github.com/cssnr/docker-context-action/discussions/categories/feature-requests\n\nIf you are experiencing an issue/bug or getting unexpected results, you can:\n\n- Report an Issue: https://github.com/cssnr/docker-context-action/issues\n- Chat with us on Discord: https://discord.gg/wXy6m2X8wY\n- Provide General Feedback: [https://cssnr.github.io/feedback/](https://cssnr.github.io/feedback/?app=Update%20Release%20Notes)\n\nFor more information, see the CSSNR [SUPPORT.md](https://github.com/cssnr/.github/blob/master/.github/SUPPORT.md#support).\n\n# Contributing\n\nIf you would like to submit a PR, please review the [CONTRIBUTING.md](#contributing-ov-file).\n\nPlease consider making a donation to support the development of this project\nand [additional](https://cssnr.com/) open source projects.\n\n[![Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/cssnr)\n\n[![Actions Tools](https://raw.githubusercontent.com/smashedr/repo-images/refs/heads/master/actions/actions-tools.png)](https://actions-tools.cssnr.com/)\n\nAdditionally, you can support other [GitHub Actions](https://actions.cssnr.com/) I have published:\n\n- [Stack Deploy Action](https://github.com/cssnr/stack-deploy-action?tab=readme-ov-file#readme)\n- [Portainer Stack Deploy Action](https://github.com/cssnr/portainer-stack-deploy-action?tab=readme-ov-file#readme)\n- [Docker Context Action](https://github.com/cssnr/docker-context-action?tab=readme-ov-file#readme)\n- [Actions Up Action](https://github.com/cssnr/actions-up-action?tab=readme-ov-file#readme)\n- [Zensical Action](https://github.com/cssnr/zensical-action?tab=readme-ov-file#readme)\n- [VirusTotal Action](https://github.com/cssnr/virustotal-action?tab=readme-ov-file#readme)\n- [Mirror Repository Action](https://github.com/cssnr/mirror-repository-action?tab=readme-ov-file#readme)\n- [Update Version Tags Action](https://github.com/cssnr/update-version-tags-action?tab=readme-ov-file#readme)\n- [Docker Tags Action](https://github.com/cssnr/docker-tags-action?tab=readme-ov-file#readme)\n- [Update JSON Value Action](https://github.com/cssnr/update-json-value-action?tab=readme-ov-file#readme)\n- [JSON Key Value Check Action](https://github.com/cssnr/json-key-value-check-action?tab=readme-ov-file#readme)\n- [Parse Issue Form Action](https://github.com/cssnr/parse-issue-form-action?tab=readme-ov-file#readme)\n- [Cloudflare Purge Cache Action](https://github.com/cssnr/cloudflare-purge-cache-action?tab=readme-ov-file#readme)\n- [Mozilla Addon Update Action](https://github.com/cssnr/mozilla-addon-update-action?tab=readme-ov-file#readme)\n- [Package Changelog Action](https://github.com/cssnr/package-changelog-action?tab=readme-ov-file#readme)\n- [NPM Outdated Check Action](https://github.com/cssnr/npm-outdated-action?tab=readme-ov-file#readme)\n- [Label Creator Action](https://github.com/cssnr/label-creator-action?tab=readme-ov-file#readme)\n- [Algolia Crawler Action](https://github.com/cssnr/algolia-crawler-action?tab=readme-ov-file#readme)\n- [Upload Release Action](https://github.com/cssnr/upload-release-action?tab=readme-ov-file#readme)\n- [Check Build Action](https://github.com/cssnr/check-build-action?tab=readme-ov-file#readme)\n- [Web Request Action](https://github.com/cssnr/web-request-action?tab=readme-ov-file#readme)\n- [Get Commit Action](https://github.com/cssnr/get-commit-action?tab=readme-ov-file#readme)\n\n\u003cdetails\u003e\u003csummary\u003e❔ Unpublished Actions\u003c/summary\u003e\n\nThese actions are not published on the Marketplace, but may be useful.\n\n- [cssnr/create-files-action](https://github.com/cssnr/create-files-action?tab=readme-ov-file#readme) - Create various files from templates.\n- [cssnr/draft-release-action](https://github.com/cssnr/draft-release-action?tab=readme-ov-file#readme) - Keep a draft release ready to publish.\n- [cssnr/env-json-action](https://github.com/cssnr/env-json-action?tab=readme-ov-file#readme) - Convert env file to json or vice versa.\n- [cssnr/push-artifacts-action](https://github.com/cssnr/push-artifacts-action?tab=readme-ov-file#readme) - Sync files to a remote host with rsync.\n- [smashedr/update-release-notes-action](https://github.com/smashedr/update-release-notes-action?tab=readme-ov-file#readme) - Update release notes.\n- [smashedr/combine-release-notes-action](https://github.com/smashedr/combine-release-notes-action?tab=readme-ov-file#readme) - Combine release notes.\n\n---\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e📝 Template Actions\u003c/summary\u003e\n\nThese are basic action templates that I use for creating new actions.\n\n- [javascript-action](https://github.com/smashedr/javascript-action?tab=readme-ov-file#readme) - JavaScript\n- [typescript-action](https://github.com/smashedr/typescript-action?tab=readme-ov-file#readme) - TypeScript\n- [py-test-action](https://github.com/smashedr/py-test-action?tab=readme-ov-file#readme) - Dockerfile Python\n- [test-action-uv](https://github.com/smashedr/test-action-uv?tab=readme-ov-file#readme) - Dockerfile Python UV\n- [docker-test-action](https://github.com/smashedr/docker-test-action?tab=readme-ov-file#readme) - Docker Image Python\n\nNote: The `docker-test-action` builds, runs and pushes images to [GitHub Container Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry).\n\n---\n\n\u003c/details\u003e\n\nFor a full list of current projects visit: [https://cssnr.github.io/](https://cssnr.github.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssnr%2Fdocker-context-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcssnr%2Fdocker-context-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcssnr%2Fdocker-context-action/lists"}