---
url: /en/build/intro.md
---
Based on the Docker ecosystem, it abstracts environments, caches, and plugins, helping developers build software in a cooler way through declarative syntax.

* Declarative: Declarative syntax, programmable and easy to share.
* Easy to manage: Managed alongside code from the same source.
* Cloud Native: Resource pooling that shields infrastructure complexity.

### Declarative Build Environment

```yaml{4}
main:
  push:
    - docker:
        image: node:20
      stages:
        - node -v
        - npm install
        - npm test
```

### Declarative Build Cache

```yaml{5,6}
main:
  push:
    - docker:
        image: node:20
        volumes:
          - /root/.npm:copy-on-write
      stages:
        - node -v
        - npm install
        - npm test
```

### Docker as Task Execution Environment

```yaml{5,8}
main:
  push:
    - stages:
        - name: run with node 20
          image: node:20
          script: node -v
        - name: run with node 21
          image: node:21
          script: node -v
```

### Docker Ecosystem Based Plugins

```yaml{5}
main:
  push:
    - stages:
        - name: hello world
          image: cnbcool/hello-world
```

### On-demand Computing Resources

```yaml{4}
main:
  push:
    - runner:
        cpus: 64
      docker:
        image: node:20
      stages:
        - node -v
        - npm install
        - npm test
```

### Workspaces

```yaml{5,6}
$:
  vscode:
    - runner:
        cpus: 64
      services:
        - vscode
      docker:
        image: node:20
        volumes:
          - node_modules:copy-on-write
      stages:
        - npm install
```

## High Performance

### CPU Freedom

* [runner.cpus](./grammar.md#cpus)

Through `runner.cpus`, you can declare required CPU resources on demand, up to **64 cores**.

### Second-level Cloning

Based on `OverlayFS`, [git-clone-yyds](https://cnb.cool/cnb/cool/git-clone-yyds) can complete code preparation in seconds, easily supporting **100GB+** super large repositories.

### Concurrent Caching

* [copy-on-write](./grammar.md#volumes)

`copy-on-write` enables copy-on-write for caches, eliminating concerns about cache read-write conflicts in concurrent scenarios.

```yaml{7,8}
main:
  push:
    - runner:
        cpus: 64
      docker:
        image: node:20
        volumes:
          - /root/.npm:copy-on-write
      stages:
        - node -v
        - npm install
        - npm test
```
