зеркало из https://github.com/docker/node-sdk.git
examples: Add README
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
This commit is contained in:
Родитель
47eb2ee287
Коммит
868903f63d
|
@ -0,0 +1,34 @@
|
|||
# Examples
|
||||
|
||||
This folder contains examples of how to use the Docker CLI JavaScript SDK.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* [Node.js 10 or later](https://nodejs.org/en/download/)
|
||||
* [yarn](https://yarnpkg.com/getting-started/install)
|
||||
|
||||
To run the examples you will need to have the Docker CLI API server running. You
|
||||
can do this by running:
|
||||
|
||||
```console
|
||||
$ docker serve --address unix:///tmp/backend.sock
|
||||
```
|
||||
|
||||
To make sure that you have the example dependencies installed, use:
|
||||
|
||||
```console
|
||||
$ yarn
|
||||
```
|
||||
|
||||
## Running examples
|
||||
|
||||
You can then run any an example from the root of this repository as follows:
|
||||
|
||||
```console
|
||||
$ npm run example examples/<file>
|
||||
```
|
||||
|
||||
## List of examples
|
||||
|
||||
* [Listing contexts](./context-ls.ts)
|
||||
* [Listing containers](./ps.ts)
|
Загрузка…
Ссылка в новой задаче