2.0.2 • Published 3 years ago

docker-multirun v2.0.2

Weekly downloads
147
License
MIT
Repository
github
Last release
3 years ago

docker-multirun

Run a docker container via docker-run multiple times. Works like docker-compose by keeping the container and reusing the volumes.

There are many cases where you run a task repeatedly, but do not want to throw away the whole container. One frequent task is running tests in a docker container. You want to keep the installed node_modules files and then run the tests multiple times.

docker-multirun is like docker-run, but reuses the volumes of the already-existing container. This way, generated files from the previous run are kept. This behavior is also known from docker-compose.

Install

# npm
$ npm install docker-multirun

# Yarn
$ yarn add docker-multirun

Usage

# Using yarn
$ npx docker-multirun node:12 bash -c "npm ci && npm test"

# Using npm
$ yarn docker-multirun node:12 bash -c "yarn --frozen-lockfile && yarn test"

# Mounting volumes
$ yarn docker-multirun node:12 -v $(pwd):/app -v /app/node_modules bash -c "yarn --frozen-lockfile && yarn test"
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...

# Run it again
$ yarn docker-multirun node:12 -v $(pwd):/app -v /app/node_modules bash -c "yarn --frozen-lockfile && yarn test"
[1/4] 🔍  Resolving packages...
success Already up-to-date.

# That was the fast lane!

Custom container name

You can give your container a custom name by using the --name option, which is part of docker-run.

Contribute

Are you missing something or want to contribute? Feel free to file an issue or a pull request! ⚙️

Support

Hey, I am Sebastian Landwehr, a freelance web developer, and I love developing web apps and open source packages. If you want to support me so that I can keep packages up to date and build more helpful tools, you can donate here:

Thanks a lot for your support! ❤️

License

MIT License © Sebastian Landwehr

2.0.2

3 years ago

1.0.14

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago