{"id":15753556,"url":"https://github.com/dmotte/docker-portmap-client","last_synced_at":"2025-08-03T23:08:11.111Z","repository":{"id":116427577,"uuid":"353821387","full_name":"dmotte/docker-portmap-client","owner":"dmotte","description":"🐳 Docker image you can use to expose one or more TCP ports to the internet using an SSH tunnel","archived":false,"fork":false,"pushed_at":"2025-07-01T20:45:30.000Z","size":432,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T23:36:02.833Z","etag":null,"topics":["client","docker","docker-compose","docker-image","dockerfile","expose","forward","forwarding","openssh","port","port-forwarding","portmap","private-key","remote","ssh","ssh-client","tcp","tunnel"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/dmotte/portmap-client","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmotte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-01T20:40:06.000Z","updated_at":"2025-07-01T20:45:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca82398d-3cac-4017-a5dd-90be8cb65916","html_url":"https://github.com/dmotte/docker-portmap-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dmotte/docker-portmap-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fdocker-portmap-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fdocker-portmap-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fdocker-portmap-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fdocker-portmap-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmotte","download_url":"https://codeload.github.com/dmotte/docker-portmap-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmotte%2Fdocker-portmap-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268625009,"owners_count":24280188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["client","docker","docker-compose","docker-image","dockerfile","expose","forward","forwarding","openssh","port","port-forwarding","portmap","private-key","remote","ssh","ssh-client","tcp","tunnel"],"created_at":"2024-10-04T07:41:10.201Z","updated_at":"2025-08-03T23:08:11.081Z","avatar_url":"https://github.com/dmotte.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-portmap-client\n\n![icon](icon-149.png)\n\n[![GitHub main workflow](https://img.shields.io/github/actions/workflow/status/dmotte/docker-portmap-client/main.yml?branch=main\u0026logo=github\u0026label=main\u0026style=flat-square)](https://github.com/dmotte/docker-portmap-client/actions)\n[![Docker Pulls](https://img.shields.io/docker/pulls/dmotte/portmap-client?logo=docker\u0026style=flat-square)](https://hub.docker.com/r/dmotte/portmap-client)\n\nThis is a :whale: **Docker image** you can use to expose **one or more TCP ports** to the internet using an **SSH tunnel**.\n\nIt works by connecting to a (publicly exposed) SSH server; this can be for example an instance of the **[dmotte/portmap-server](https://github.com/dmotte/docker-portmap-server.git) image**, or an online **SSH tunneling service** such as [portmap.io](https://portmap.io/) or [ngrok.com](https://ngrok.com/).\n\n**Note**: this image runs as an **unprivileged user** (**non-root**).\n\n\u003e :package: This image is also on **Docker Hub** as [`dmotte/portmap-client`](https://hub.docker.com/r/dmotte/portmap-client) and runs on **several architectures** (e.g. amd64, arm64, ...). To see the full list of supported platforms, please refer to the [`.github/workflows/main.yml`](.github/workflows/main.yml) file. If you need an architecture which is currently unsupported, feel free to open an issue.\n\n## Usage\n\nFor this section, we assume that you have already set up an SSH server for remote port forwarding (such as [`dmotte/portmap-server`](https://hub.docker.com/r/dmotte/portmap-server)) or you use an online port forwarding service.\n\nThis Docker image only supports **SSH public key authentication**, so we assume that you have a :key: **private key file** (hereinafter called `ssh_client_key`) to log in to the server. Please note that the private key file must be kept **unencrypted**, as otherwise the SSH client would ask for the passphrase at startup. Plus, it must be readable by the `portmap` **unprivileged user** inside the container.\n\nThen you'll need an SSH `known_hosts` file containing the **public key** of your server. To obtain it, you can use the following command (replace the server address and port with yours):\n\n```bash\nssh-keyscan -p2222 10.0.2.15 \u003e known_hosts\n```\n\n\u003e **Note**: if you want, you can bypass the known_hosts step by adding `-o StrictHostKeyChecking=no` to the SSH command, but it's **highly discouraged** for security reasons. Please refer to the [OpenSSH client manual page](https://linux.die.net/man/1/ssh) for further information.\n\nNow suppose that you want to publicly expose (using portmap.io) a web service running locally in your LAN at `http://192.168.0.123:8080/`. You can start your portmap client container like this:\n\n```bash\ndocker run -it --rm \\\n    -v \"$PWD/known_hosts:/known_hosts:ro\" \\\n    -v \"$PWD/ssh_client_key:/ssh_client_key:ro\" \\\n    dmotte/portmap-client \\\n    myuser.mycfg@myuser-12345.portmap.io -NvR12345:192.168.0.123:8080\n```\n\nFor a more complex example, refer to the [`docker-compose.yml`](docker-compose.yml) file.\n\n### Environment variables\n\nList of supported **environment variables**:\n\n| Variable             | Required         | Description                                                                                                                                             |\n| -------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `KEEPALIVE_INTERVAL` | No (default: 30) | Value for the **`ServerAliveInterval`** option of the OpenSSH client                                                                                    |\n| `AUTO_RESTART`       | No (default: -1) | If != -1, **automatically restart** the OpenSSH client after the given interval whenever it exits. Some examples: `.5`, `0.5s`, `30`, `30s`, `5m`, `1h` |\n\n### Volumes\n\n| Type | Internal path     | Required | Description                                                                                                                                                     |\n| ---- | ----------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| File | `/known_hosts`    | No       | File containing the **SSH server's public key**(s)                                                                                                              |\n| File | `/ssh_client_key` | **Yes**  | **Unencrypted private key file** that will be used by the OpenSSH client to authenticate itself. It must be readable by the `portmap` user inside the container |\n\n## Development\n\nIf you want to contribute to this project, you can use the following one-liner to **rebuild the image** and bring up the **Docker-Compose stack** every time you make a change to the code:\n\n```bash\ndocker-compose down \u0026\u0026 docker-compose up --build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmotte%2Fdocker-portmap-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmotte%2Fdocker-portmap-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmotte%2Fdocker-portmap-client/lists"}