0

We can configure the docker files to install packages from an already prepared list(such as package.json, go.mod) of dependencies.

Consider a situation where npm is not installed in the host machine. A developer runs a node application in a docker container in a development environment. If they want to install a package from the host machine, how'll they perform it?

I know they can modify the package.json and restart the container or get into the container and install the package there. But it'll be a hassle for developers who needs a seamless workflow.

Is there any way to bind the npm install <package> from the host to the container?

Santhosh M
  • 11
  • 1
  • You could alias npm to docker exec... – Software Engineer Dec 30 '22 at 05:10
  • Nothing you do with Docker will be simpler than `apt-get install nodejs` or a similar host package-manager command. The Docker container by design is isolated from the host system, so the container _can't_ install packages from the host system. – David Maze Dec 30 '22 at 12:11

0 Answers0