---
slug: /quickstart/349011/build
displayed_sidebar: "quickstart"
hide_table_of_contents: true
title: "Build the application"
---

# Quickstart

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import QuickstartDoc from '@site/src/components/quickstartDoc.js'
import Embed from '@site/src/components/embed.js'

export const ids = {
    Go: "smjo0gkeiFz",
    "Node.js": "5i8mcHTVJ-x",
    Python: "E8rjb5DFd2m"
}

<QuickstartDoc embeds={ids}>

## Build the application

If your application passes all its tests, the typical next step is to build it.

So, let's update the previous pipeline and add a build step to it, by running `npm run build`.

:::tip
The `npm run build` command is appropriate for a React application, but other applications are likely to use different commands. Modify your Dagger pipeline accordingly.
:::

<Tabs groupId="language" className="embeds">
<TabItem value="Go">

<Embed id="smjo0gkeiFz" />

- It invokes the `Container.WithExec()` method again, this time to define the command `npm run build` in the container.
- It obtains a reference to the `build/` directory in the container with the `Container.Directory()` method. This method returns a `Directory` object.
- It writes the `build/` directory from the container to the host using the `Directory.Export()` method.

Run the pipeline by executing the command below from the application directory:

```shell
dagger run go run ci/main.go
```

</TabItem>
<TabItem value="Node.js">

<Embed id="5i8mcHTVJ-x" />

This revised pipeline does everything described in the previous step, and then performs the following additional operations:

- It invokes the `Container.withExec()` method again, this time to define the command `npm run build` in the container.
- It obtains a reference to the `build/` directory in the container with the `Container.directory()` method. This method returns a `Directory` object.
- It writes the `build/` directory from the container to the host using the `Directory.export()` method.

Run the pipeline by executing the command below from the application directory:

```shell
dagger run node ci/index.mjs
```

</TabItem>
<TabItem value="Python">

<Embed id="E8rjb5DFd2m" />

This revised pipeline does everything described in the previous step, and then performs the following additional operations:

- It invokes the `Container.with_exec()` method again, this time to define the command `npm run build` in the container.
- It obtains a reference to the `build/` directory in the container with the `Container.directory()` method. This method returns a `Directory` object.
- It writes the `build/` directory from the container to the host using the `Directory.export()` method.

Run the pipeline by executing the command below from the application directory:

```shell
dagger run python ci/main.py
```

</TabItem>
</Tabs>

After Dagger resolves the pipeline, the built application is available in a new `build/` sub-directory of the application directory. Confirm this by executing the `tree` command in the application directory, as shown below:

```shell
tree build
build/
├── asset-manifest.json
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
├── robots.txt
└── static
    ├── css
    │   ├── main.073c9b0a.css
    │   └── main.073c9b0a.css.map
    └── js
        ├── 787.305db8b6.chunk.js
        ├── 787.305db8b6.chunk.js.map
        ├── main.5e49019b.js
        ├── main.5e49019b.js.LICENSE.txt
        └── main.5e49019b.js.map

3 directories, 14 files

```

</QuickstartDoc>
