mirror of
https://github.com/danbulant/docker-compose
synced 2026-06-15 20:51:27 +00:00
readme
This commit is contained in:
parent
4d7fac4b2a
commit
e601a19e4b
1 changed files with 19 additions and 6 deletions
25
readme.md
25
readme.md
|
|
@ -12,13 +12,21 @@ npm install --save-dev docker-compose
|
|||
|
||||
`docker-compose` current supports these commands:
|
||||
|
||||
* up - create and start containers - always uses the `-d` flag due to non interactive mode
|
||||
* down - Stop and remove containers, networks, images, and volumes
|
||||
* kill - Kill containers
|
||||
* stop - Stop services
|
||||
* rm - Remove stopped containers - always uses the `-f` flag due to non interactive mode
|
||||
* `up(options)` - create and start containers - always uses the `-d` flag due to non interactive mode
|
||||
* `down(options)` - Stop and remove containers, networks, images, and volumes
|
||||
* `kill(options)` - Kill containers
|
||||
* `stop(options)` - Stop services
|
||||
* `rm(options)` - Remove stopped containers - always uses the `-f` flag due to non interactive mode
|
||||
* `exec(container, command, options)` - Exec `command` inside `container`, uses `-T` to properly handle stdin & stdout
|
||||
* `run(container, command, options)` - Run `command` inside `container`, uses `-T` to properly handle stdin & stdout
|
||||
|
||||
All commands return a Promise.
|
||||
All commands return a `Promise({object})` with an stdout and stderr strings
|
||||
```javascript
|
||||
{
|
||||
out: 'stdout contents'
|
||||
err: 'stderr contents'
|
||||
}
|
||||
```
|
||||
|
||||
### Example
|
||||
|
||||
|
|
@ -32,6 +40,11 @@ compose.up({ cwd: path.join(__dirname), log: true })
|
|||
);
|
||||
```
|
||||
|
||||
To execute command inside a running container
|
||||
```javascript
|
||||
compose.exec('node', 'npm install', { cwd: path.join(__dirname) })
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
`docker-compose` accepts these params:
|
||||
|
|
|
|||
Loading…
Reference in a new issue