Hello š
I want to run npm run build
scripts using a Dockerfile/docker-compose.yml
file and get the build output on my host file system. Is there any way I can achieve this?
Basically, what I'm looking for is to run a single command, like
docker-compose up
# OR
docker build -t my-builder . && docker run my-builder
# or maybe even a shell script
which would spin up a container, run the npm build
script inside the container, and with the help of either a volume or bind mount (or some other concept I'm not aware of š
) put the build output on a specified directory on the host file system.
Any help would be greatly appreciated š.
Thanks!!
Top comments (2)
I think, I get what you are trying to achieve. We used to do a similar thing for generating linux Golang binaries from our Macbook by running a single docker command
The following command will do the trick for you
Thanks Neel, this worked as expected