https://github.com/zenflow/docker-run-kill
CLI wrapping `docker run` to kill container when process is terminated
https://github.com/zenflow/docker-run-kill
Last synced: about 1 year ago
JSON representation
CLI wrapping `docker run` to kill container when process is terminated
- Host: GitHub
- URL: https://github.com/zenflow/docker-run-kill
- Owner: zenflow
- License: mit
- Created: 2020-09-04T11:19:55.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-13T20:06:01.000Z (over 5 years ago)
- Last Synced: 2025-03-13T22:47:29.101Z (over 1 year ago)
- Language: JavaScript
- Size: 185 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-run-kill
CLI wrapping `docker run` to kill container when CLI is terminated
[](http://npmjs.com/package/docker-run-kill)
[](https://github.com/zenflow/docker-run-kill/actions?query=branch%3Amaster)
[](https://david-dm.org/zenflow/docker-run-kill)
[](https://codeclimate.com/github/zenflow/docker-run-kill)
[](https://lgtm.com/projects/g/zenflow/docker-run-kill/)
[](https://snyk.io/test/github/zenflow/docker-run-kill?targetFile=package.json)
[](https://github.com/zenflow/docker-run-kill/issues)
[](https://github.com/zenflow/docker-run-kill/pulls)
[](https://opensource.org/licenses/MIT)
## What is it?
Terminating a `docker run` command does not always result in the container being killed.
This CLI fixes that by wrapping `docker run` and killing the container before exiting when a termination signal is received.
## Installation
npm
```
$ npm install docker-run-kill
```
yarn
```
$ yarn add docker-run-kill
```
## Usage
```
$ docker-run-kill --help
Usage: docker-run-kill [RUN-KILL OPTIONS] [KILL OPTIONS] [RUN OPTIONS] IMAGE [COMMAND] [ARG...]
Run a command in a new container and kill that container when process is terminated.
Run-kill Options:
--help Output usage information
--name string Assign a name to the container (default is "docker_run_kill_{x}" where {x} is a random number)
Documentation for Kill Options & Run Options can be output with `docker kill --help` & `docker run --help` respectively.
*Important* To assign a name to the container, pass `--name` as a Run-kill Option, not a Run Option, since the latter won't be recognized.
```