> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# buildpacks/pack

Cloud Native Buildpacks Orb

## Commands

### install-pack

Setup and install pack

| Parameter | Type | Default | Description |
|---|---|---|---|
| `install-dir` | string | ~/bin | Directory in which to install Pack binary
 |
| `version` | string | 0.20.0 |  |

### pack-build

Run pack build

| Parameter | Type | Default | Description |
|---|---|---|---|
| `builder` | string |  | The builder image name to use for building. |
| `buildpacks` | string |  | The specific buildpacks to execute. Semicolon (;) delimited. |
| `env-vars` | string |  | Environment variables to set during the build. Semicolon (;) delimited. |
| `image-name` | string |  | The primary image name to save the image as. |
| `path` | string |  | The path to the working directory to run `pack build` in. |
| `tags` | string |  | Additional image names to create. Semicolon (;) delimited. |

### save-image-to-workspace

Save image to file

| Parameter | Type | Default | Description |
|---|---|---|---|
| `image-file` | string |  |  |
| `image-name` | string |  |  |

## Jobs

### build

Build OCI Image

| Parameter | Type | Default | Description |
|---|---|---|---|
| `after-checkout` | steps |  | Optional steps to run after checking out the code. |
| `builder` | string |  | Builder image name to use. |
| `buildpacks` | string |  | The specific buildpacks to execute. Semicolon (;) delimited. |
| `env-vars` | string |  | Build-time environment variables. Semicolon (;) delimited. |
| `executor-image` | string | ubuntu-2004:202010-01 | Image to execute 'pack' in. |
| `image-file` | string | image.tgz | Filename to save the app image as locally. |
| `image-name` | string |  | Image name (aka tag) of the app image to be produced. |
| `tags` | string |  | Additional image names to create. Semicolon (;) delimited. |
| `version` | string | 0.18.1 | Version of 'pack' to use. |
| `working-directory` | string |  | The directory where the app source is located. |

## Examples

### basic

Basic usage

```yaml
version: '2.1'
orbs:
  buildpacks: buildpacks/pack@x.y.z
workflows:
  main:
    jobs:
      - buildpacks/build:
          builder: heroku/buildpacks:18
          image-name: myimage
```

### build-and-publish

Build and publish

```yaml
version: '2.1'
orbs:
  buildpacks: buildpacks/pack@x.y.z
jobs:
  publish:
    machine: true
    steps:
      - attach_workspace:
          at: /tmp/workspace
      - run:
          command: |
            docker load -i /tmp/workspace/images/myimage.tgz
            docker push myimage
workflows:
  main:
    jobs:
      - buildpacks/build:
          builder: heroku/buildpacks:18
          image-file: myimage.tgz
          image-name: myimage
      - publish:
          requires:
            - buildpacks/build
```

### explicit-buildpacks

Run specific buildpacks

```yaml
version: '2.1'
orbs:
  buildpacks: buildpacks/pack@x.y.z
workflows:
  main:
    jobs:
      - buildpacks/build:
          builder: heroku/buildpacks:18
          buildpack: heroku/ruby
          image-name: myimage
```