{"id":31260189,"url":"https://github.com/artemkaxboy/docker-opener","last_synced_at":"2026-01-12T11:39:04.493Z","repository":{"id":46002222,"uuid":"387781770","full_name":"artemkaxboy/docker-opener","owner":"artemkaxboy","description":"Shell-in to any docker container easily","archived":false,"fork":false,"pushed_at":"2023-01-12T06:35:47.000Z","size":83,"stargazers_count":40,"open_issues_count":14,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-23T09:02:55.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artemkaxboy.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}},"created_at":"2021-07-20T12:17:23.000Z","updated_at":"2025-09-15T06:45:13.000Z","dependencies_parsed_at":"2023-02-09T10:20:15.619Z","dependency_job_id":null,"html_url":"https://github.com/artemkaxboy/docker-opener","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/artemkaxboy/docker-opener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemkaxboy%2Fdocker-opener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemkaxboy%2Fdocker-opener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemkaxboy%2Fdocker-opener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemkaxboy%2Fdocker-opener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artemkaxboy","download_url":"https://codeload.github.com/artemkaxboy/docker-opener/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemkaxboy%2Fdocker-opener/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2025-09-23T09:01:18.841Z","updated_at":"2026-01-12T11:39:04.450Z","avatar_url":"https://github.com/artemkaxboy.png","language":"Python","funding_links":[],"categories":["Containers"],"sub_categories":["Shell into containers"],"readme":"# Docker opener\n\nManage your docker containers easily\n\n## What is it\n\nIt is a tool to simplify everyday work with running containers and compose-projects.\n\nThe main features of `docker opener`:\n\n* [Simple shell access to **any** container](#simple-shell-access-to-any-container)\n* [Managing containers **without remembering** their full **names**](#managing-containers-without-remembering-their-full-names)\n* [**Upgrading images** of running containers](#upgrading-images-of-running-containers)\n* [Managing compose-project **without entering** their work **directories**](#managing-compose-project-without-entering-their-work-directories)\n* [**Recreating running container**, especially to start on local built images](#recreating-running-container)\n\n## Installation\n\nThe `opener` is just a regular docker image it may be used **without installation**: \n\n```shell\ndocker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock artemkaxboy/opener [COMMAND] [PARAMS]\n```\n\nLinux aliases can be used to **make the command shorter**. For only current terminal session:\n\n```shell\nalias opener='docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock artemkaxboy/opener'\n```\n\nOr permanently (re-login required):\n\n```shell\necho \"alias opener='docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock artemkaxboy/opener'\" \u003e\u003e ~/.bash_aliases\n```\n\nPowershell installation. Add to profile:\n\n```powershell\nfunction __opener_alias { \n    docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock artemkaxboy/opener $args\n}\n\nNew-Alias -Name opener -Value __opener_alias\n```\n\n### Alias usage\n\nAfter adding alias you can use short form:\n\n```shell\n# long\ndocker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock artemkaxboy/opener [COMMAND] [PARAMS]\n# short\nopener [COMMAND] [PARAMS]\n```\n\n### Update\n\n```shell\n$ opener update\nUsing default tag: latest\nlatest: Pulling from artemkaxboy/opener\n...\n```\n\n## How to use\n\n### Commands\n\n#### Special commands\n\n| Command | Result |\n| --- | --- |\n| `help` | Show help message |\n| `update` | Update (pull) `opener` image |\n| `version` | Show `opener` version |\n\n#### Container commands supported by opener\n\n| Command | Regular docker example | Opener short example | Result |\n| --- | --- | --- | --- |\n| `--` | `docker exec -it nginx bash` | `opener -- ng` | Run new shell process in the container and connect |\n| `attach` | `docker attach nginx` | `opener a ng` | Attach local standard input, output, and error streams to a running container |\n| `exec` | `docker exec nginx date` | `opener e ng date` | Run a command in a running container |\n| `inspect` | `docker inspect nginx` | `opener i ng` | Return low-level information on Docker objects |\n| `kill` | `docker kill nginx` | `opener k ng` | Kill one or more running containers |\n| `logs` | `docker logs nginx -f` | `opener l ng -f` | Fetch the logs of a container |\n| `pause` | `docker pause nginx` | `opener p ng` | Pause all processes within one or more containers |\n| `port`| | `opener port portainer 443 9443` | Temporary forward host port 443 to portainer container to port 9443 |\n| `recreate` | | `opener recreate ng` | Kill and Remove running container and Create and Run the same container |\n| `restart` | `docker restart nginx` | `opener res ng` | Restart one or more containers |\n| `rm` | `docker rm nginx` | `opener rm ng` | Remove one or more containers |\n| `start` | `docker start nginx` | `opener sta ng` | Start one or more stopped containers |\n| `stop` | `docker stop nginx` | `opener sto ng` | Stop one or more running containers |\n| `unpause` | `docker unpause nginx` | `opener unpause ng` | Unpause all processes within one or more containers |\n| `upgrade` | | `opener upgrade ng` | Pull container's image, Kill and Remove running container, Create and Run the same container with updated image |\n\n`ng` - an example of how to use a part of a name of needed container, e.g. `nginx` -\u003e `ng`\n\n#### Compose commands supported by opener\n\nAll regular docker-compose examples must be run in the compose.yaml file directory, whereas opener compose command only requires a part of the name of a running compose-project.\n\n| Command | Regular docker-compose example | Opener short example | Result |\n| --- | --- | --- | --- |\n| `compose-down` | `docker-compose down` |  `opener cdown app` | Stop and remove resources |\n| `compose-kill` | `docker-compose kill` |  `opener ckill app` | Stop and remove composes resources |\n| `compose-list` | | `opener clist` | Show all compose projects |\n| `compose-logs` | `docker-compose logs` |  `opener clogs app` | View output from containers |\n| `compose-ps` | `docker-compose ps` |  `opener cps app` | List containers |\n| `compose-start` | `docker-compose start` |  `opener cstart app` | Start services |\n| `compose-stop` | `docker-compose stop` |  `opener cstop app` | Stop services |\n| `compose-top` | `docker-compose top` |  `opener ctop app` | Display the running processes |\n\n`app` - is a name/part of a name of running compose-project, which is usually equals to the name of docker-compose file's directory.\n\nAll \"Regular docker-compose examples\" must be run in the directory of the compose-file, whereas opener commands can be run from anywhere.\n\n### Examples\n\n#### Simple shell access to any container\n\nTo access container shell `opener` checks if the container already have one `bash` or `sh` and use it, if not `opener` will install busybox into the running target container and connect to the container using it. Busybox will be wiped out from the container on disconnecting.\n\nRun any container:\n\n```shell\n$ docker run -d --name docker-web portainer/portainer-ce\n62f87fb2...\n```\n\nConnect it by `name`:\n\n```shell\n$ opener web\nFound container with name containing: web\n...\nInstalling busybox...\nConnecting...\n/ # hostname\n62f87fb2ce5f\n/ # exit\nRemoving busybox...\n```\n\nBy `image name`:\n\n```shell\n$ opener port\nFound container with image `portainer/portainer-ce` containing `port`\n...\n```\n\nBy `exposed port number`:\n\n```shell\n$ opener 9000\nFound container with port containing: 9000\n...\n```\n\nBy `ID`:\n\n```shell\n$ opener 62f8\nFound container with ID containing: 62f8\n...\n```\n\n#### Managing containers without remembering their full names\n\nAny [supported container command](#container-commands-supported-by-opener) can be performed using a short unique container's attribute.\n\nWith Example:\n\n```shell\n$ docker ps\nCONTAINER ID   IMAGE     COMMAND                  CREATED         STATUS        PORTS           NAMES\nc072485d836e   postgres  \"docker-entrypoint.s…\"   6 seconds ago   Up 1 second   5432-\u003e5432/tcp  site_database_1\nd443a12c54e1   app:v1.0  \"/myapp\"                 5 seconds ago   Up 3 second   80-\u003e8080/tcp    site_app_1\n```\n\nThe following commands can be performed:\n\n```shell\n# restart container by name\nopener restart app\n\n# kill container by exposed port\nopener kill 5432\n\n# stop container by image name\nopener stop postgre\n```\n\n#### Upgrading images of running containers\n\nFinding run command of container which was run weeks ago might be a challenge. `opener` can upgrade your containers without manually typing all command.\n\nExample, once run container:\n\n```shell\ndocker run -d --name=netdata \\\n  -p 19999:19999 \\\n  -v netdataconfig:/etc/netdata \\\n  -v netdatalib:/var/lib/netdata \\\n  -v netdatacache:/var/cache/netdata \\\n  -v /etc/passwd:/host/etc/passwd:ro \\\n  -v /etc/group:/host/etc/group:ro \\\n  -v /proc:/host/proc:ro \\\n  -v /sys:/host/sys:ro \\\n  -v /etc/os-release:/host/etc/os-release:ro \\\n  --restart unless-stopped \\\n  --cap-add SYS_PTRACE \\\n  --security-opt apparmor=unconfined \\\n  netdata/netdata\n```\n\nThere is no need to find the whole command again, `opener upgrade` do the job:\n\n```shell\n$ opener upgrade netdata\nFound container with name `netdata`\nCONTAINER ID        IMAGE               COMMAND              CREATED             STATUS                 PORTS                                           NAMES\n3348bc4acdb7        netdata/netdata     \"/usr/sbin/run.sh\"   8 weeks ago         Up 5 weeks (healthy)   0.0.0.0:19999-\u003e19999/tcp, :::19999-\u003e19999/tcp   netdata\n\nPulling image `netdata/netdata`...\nRecreating `netdata` ...\nCopying container `netdata` to `musing_haibt`\nStopping `netdata`\nDeleting `netdata`\nRenaming container `musing_haibt` to `netdata`\nStarting `netdata`\nStarted `netdata`\n```\n\n#### Managing compose-project without entering their work directories\n\nExample, sometime earlier compose-project was started:\n\n```shell\n$ docker ps\nCONTAINER ID   IMAGE        COMMAND                  CREATED       STATUS      PORTS           NAMES\nc072485d836e   postgres     \"docker-entrypoint.s…\"   6 weeks ago   Up 6 week   5432-\u003e5432/tcp  site_database_1\nd443a12c54e1   app:v1.0     \"/myapp\"                 6 weeks ago   Up 6 week   80-\u003e8080/tcp    site_app_1\n...            mongo        ...                      6 weeks ago   Up 6 week   ...             site_mongo_1\n...            web:v1.0     ...                      6 weeks ago   Up 6 week   ...             site_web_1\n...            worker:v1.0  ...                      6 weeks ago   Up 6 week   ...             site_worker_1\n...            worker:v1.0  ...                      6 weeks ago   Up 6 week   ...             site_worker_2\n```\n\nIt might be a challenge to find compose-file on the server to stop the compose-project, the file could even have been deleted since compose-project was started, in that case the last remaining option was to stop or stop/kill all containers one by one.\n\n`opener compose-stop site` and `opener compose-kill site` will help:\n\n```shell\n$ opener compose-kill site\nFound compose with name `site`\nCONTAINER ID   IMAGE     COMMAND                 CREATED       STATUS     PORTS     NAMES\nc072485d836e   postgres  \"docker-entrypoint.s…\"  6 weeks ago   Up 6 week  5432/tcp  site_database_1\nd443a12c54e1   app:v1.0  \"/myapp\"                6 weeks ago   Up 6 week  80/tcp    site_app_1\n...\n\nKilling site_database_1  ... done\nKilling site_app_1       ... done\nKilling site_mongo_1     ... done\n...\n```\n\n#### Recreating running container\n\nExample, your project is running with database and many other modules:\n\n```shell\n$ docker ps\nCONTAINER ID   IMAGE        COMMAND                  CREATED       STATUS      PORTS           NAMES\nc072485d836e   postgres     \"docker-entrypoint.s…\"   6 weeks ago   Up 6 week   5432-\u003e5432/tcp  site_database_1\nd443a12c54e1   app:v1.0     \"/myapp\"                 6 hours ago   Up 6 hour   80-\u003e8080/tcp    site_app_1\n...            mongo        ...                      6 weeks ago   Up 6 week   ...             site_mongo_1\n...            web:v1.0     ...                      6 weeks ago   Up 6 week   ...             site_web_1\n```\n\nYou made a new build of one of your modules `app:v1.0` and want to test or run it without restarting the whole compose-project. \n\n`opener recreate` do it, new container will be created with new build of `app:v1.0`:\n\n```shell\n$ docker build -t app:v1.0 .\n...\n$ opener recreate app\nFound container with name `site_app_1` containing `app`\nCONTAINER ID  IMAGE     COMMAND   CREATED       STATUS      PORTS         NAMES\nd443a12c54e1  app:v1.0  \"/myapp\"  6 hours ago   Up 6 hour   80-\u003e8080/tcp  site_app_1\n\nRecreating `site_app_1` ...\nCopying container `site_app_1` to `suspicious_bhabha`\nStopping `site_app_1`\nDeleting `site_app_1`\nRenaming container `suspicious_bhabha` to `site_app_1`\nStarting `site_app_1`\nStarted `site_app_1`\n```\n\n## License\n\nApache License 2.0, see [LICENSE](https://github.com/artemkaxboy/docker-opener/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemkaxboy%2Fdocker-opener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartemkaxboy%2Fdocker-opener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemkaxboy%2Fdocker-opener/lists"}