{"id":22962082,"url":"https://github.com/actionanand/node-util","last_synced_at":"2026-04-16T22:31:10.078Z","repository":{"id":214465999,"uuid":"736556950","full_name":"actionanand/node-util","owner":"actionanand","description":"This docker utility container will help us execute npm commands without installing node in our machine. I've used node 20.10-alpine version in this project.","archived":false,"fork":false,"pushed_at":"2023-12-31T17:42:36.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T03:28:25.401Z","etag":null,"topics":["docker","docker-compose","node-alpine","node20"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/actionanand.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}},"created_at":"2023-12-28T08:19:20.000Z","updated_at":"2023-12-28T10:35:46.000Z","dependencies_parsed_at":"2025-04-02T03:38:31.951Z","dependency_job_id":null,"html_url":"https://github.com/actionanand/node-util","commit_stats":null,"previous_names":["actionanand/node-util"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/actionanand/node-util","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actionanand%2Fnode-util","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actionanand%2Fnode-util/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actionanand%2Fnode-util/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actionanand%2Fnode-util/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/actionanand","download_url":"https://codeload.github.com/actionanand/node-util/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/actionanand%2Fnode-util/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31907424,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"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":["docker","docker-compose","node-alpine","node20"],"created_at":"2024-12-14T19:15:12.391Z","updated_at":"2026-04-16T22:31:10.048Z","avatar_url":"https://github.com/actionanand.png","language":"Dockerfile","readme":"# Docker Utility Containers \u0026 Executing Commands - (Section 5)\r\n\r\nThis docker utility container will help us execute npm commands without installing node in our machine. I've used node 20.10-alpine version in this project.\r\n\r\n## How to run node in interactive mode as shell in our machine\r\n\r\n```shell\r\ndocker run -it --rm --name node-util node:20.10-alpine\r\n```\r\n\r\n![image](https://github.com/actionanand/node-util/assets/46064269/0e99e84b-5c5a-4f87-880b-dda5e5e3526f)\r\n\r\n\r\n## How to run node in interactive mode without any Dockerfile in terminal to use npm commands\r\n\r\n```bash\r\ndocker run -it -d --rm --name node-util node:20.10-alpine\r\n```\r\n\r\n- Executing npm command (say `npm init`)\r\n\r\n```bash\r\ndocker exec -it node-util npm init\r\n```\r\n\r\nThe docker `exec` command helps us to execute(run) a new command inside the running container. \r\n\r\n![image](https://github.com/actionanand/node-util/assets/46064269/873a981b-fbdd-4a88-9b09-8971fbddbfde)\r\n\r\n## Set-up using Dockerfile\r\n\r\n1. Build the image\r\n\r\n```shell\r\ndocker build . -t actionanand/node-util\r\n```\r\n\r\n2. You can run any command begining with `npm` (leave `npm` and add remaining at the end of following command)\r\n\r\n```bash\r\ndocker run -it --rm --name node-util -v \"D:\\AR_extra\\rnd\\docker\\node-util:/app\" actionanand/node-util\r\n```\r\n\r\nFor wsl2, mac and linux\r\n\r\n```bash\r\ndocker run -it --rm --name node-util -v $(pwd):/app actionanand/node-util\r\n```\r\n\r\nTo run `npm init` command\r\n\r\n```bash\r\ndocker run -it --rm --name node-util -v $(pwd):/app actionanand/node-util init\r\n```\r\n\r\nTo run `npm install express`\r\n\r\n```shell\r\ndocker run -it --rm --name node-util -v $(pwd):/app actionanand/node-util install express\r\n```\r\n\r\n![image](https://github.com/actionanand/node-util/assets/46064269/76df332e-3c6f-483f-a7f7-9e44975eac4c)\r\n\r\n\r\n## Set-up using docker-compose\r\n\r\n* `docker-compose run` is used to run **single service** from multiple services present indide `docker-compose.yaml`\r\n\r\nUsage\r\n\r\n```bash\r\ndocker-compose run --rm \u003cservice_name\u003e\r\n```\r\n\r\nConsider `npm-util` is the registered service name in `docker-compose.yaml` and If you want to execute `npm init`, the following will be the command to be executed!\r\n\r\n```bash\r\ndocker-compose run --rm npm-util init\r\n```\r\n\r\nSo if `npm` is the registered service name,\r\n\r\n```bash\r\ndocker-compose run --rm npm init\r\n```\r\n\r\n![image](https://github.com/actionanand/node-util/assets/46064269/ff420eb6-8413-481c-baf2-996aab5c9154)\r\n\r\n### Docker Image's public URL\r\n\r\n* [actionanand/node-util](https://hub.docker.com/r/actionanand/node-util)\r\n\r\n  ![image](https://github.com/actionanand/node-util/assets/46064269/fc32e142-3651-4dd8-a754-ee94c33d035a)\r\n\r\n## Associated repos:\r\n\r\n1. [Docker Basics](https://github.com/actionanand/docker_playground)\r\n2. [Managing Data and working with volumes](https://github.com/actionanand/docker_data_volume)\r\n3. [Docker Communication](https://github.com/actionanand/docker_communication)\r\n4. [Docker Multi-container with docker-compose](https://github.com/actionanand/docker_multi-container)\r\n5. [Docker Utility Containers \u0026 Executing Commands](https://github.com/actionanand/node-util)\r\n6. [Laravel with Docker](https://github.com/actionanand/laravel_with_docker)\r\n7. [Angular with Docker](https://github.com/actionanand/angular_with_docker)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factionanand%2Fnode-util","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factionanand%2Fnode-util","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factionanand%2Fnode-util/lists"}