Simpe Yarn container based on the Alpine packages
1.2K
To use this container change your working directory to your yarn project and run the container:
docker run --name yarn --rm -v "$PWD":/home/yarn knsit/yarn:1.3.2
To run for example the dev task start the container like this:
docker run --name yarn --rm -v "$PWD":/home/yarn knsit/yarn:1.3.2 run dev
If you want to use this container on Windows with Powershell use this snippet:
docker run --name yarn -v "$((pwd).Path):/home/yarn" --rm -p 8080:8080 knsit/yarn:1.3.2 run dev
If the task executed in the container exits, the container will also exit.
If you are starting a task which is continuously running (e.g. dev server with a watcher) you have to stop the container to exit the task.
The most convenient way to achieve this is to name the container (e.g. --name yarn) and stop it from a second terminal (docker stop yarn).
As the given scripts are all containing the switch --rm the container will be removed after you stop it.
If you're running a dev server inside the container you have to expose the port binded by the server inside the container. As there is no default port, the container does not expose any port by default.
To run a dev server which exposes port 8080 start the container like this:
docker run --name yarn --rm -p 8080:8080 -v "$PWD":/home/yarn knsit/yarn:1.3.2 run dev
Remark: Keep in mind that the server has to bind to 0.0.0.0 instead of localhost to be able to access the server from outside the container!
Content type
Image
Digest
Size
12.8 MB
Last updated
over 7 years ago
docker pull knsit/yarn