|
1 | 1 | --- |
2 | | -title: Creating Your First App |
| 2 | +title: Building And Deploying Your First Container |
3 | 3 | layout: default |
4 | | -parent: Your First App |
| 4 | +parent: Your First Container |
5 | 5 | nav_order: 1 |
6 | | ---- |
| 6 | + |
| 7 | +nav_exclude: false |
| 8 | +search_exclude: true |
| 9 | +--- |
| 10 | + |
| 11 | +# Building and Deploying Your First App |
| 12 | + |
| 13 | +Now that you have set up your development environment, you're ready to build and deploy your first container-based application with Ocre. This guide will walk you through the process of building a sample application from our getting-started repository. |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## Prerequisites |
| 18 | + |
| 19 | +Before proceeding, ensure you have: |
| 20 | +- Completed the [Setting Up Your Development Environment](../dev-environment) guide |
| 21 | +- Cloned the [`getting-started`](https://github.com/project-ocre/getting-started) repository |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## Building Your First Container |
| 26 | + |
| 27 | +Let's build your first Ocre container using one of our sample applications. |
| 28 | + |
| 29 | +1. **Navigate to the Samples Directory** |
| 30 | + ``` |
| 31 | + cd getting-started/samples |
| 32 | + ``` |
| 33 | +2. **Choose a Sample Application:** Browse through the available samples and choose one that interests you. Each sample demonstrates different capabilities of the Ocre platform. |
| 34 | + |
| 35 | +3. **Create and Enter Build Directory:** Once you have jumped into the sample of your choosing, lets create the build directory. |
| 36 | +``` |
| 37 | +mkdir build && cd build |
| 38 | +``` |
| 39 | + |
| 40 | +4. **Configure the Build** |
| 41 | +``` |
| 42 | +cmake -DWASI_SDK_DIR=/opt/wasi-sdk \ |
| 43 | + -DCMAKE_TOOLCHAIN_FILE=/opt/wamr-sdk/app-sdk/wamr_toolchain.cmake .. |
| 44 | +``` |
| 45 | + |
| 46 | +5. **Build the Container** |
| 47 | +``` |
| 48 | +make |
| 49 | +``` |
| 50 | + |
| 51 | +After successful compilation, you'll find a `sample.nbx` file in your build directory (where "sample" matches your chosen sample name). This is your containerized application, ready for deployment. |
| 52 | + |
| 53 | +{: .important} |
| 54 | +If the build fails, ensure you're running these commands within the dev container or interactive Docker environment, not on your host system. |
| 55 | + |
| 56 | + |
| 57 | +## Deploying Your First Container |
| 58 | + |
| 59 | +Now that you've built your container, let's get it running on your device. |
| 60 | + |
| 61 | +{: .important} |
| 62 | +Steps to be updated soon |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## What's Next? |
| 67 | +Now that you've successfully built your first container, you can: |
| 68 | + |
| 69 | +- Explore other [samples](../../../samples) to learn more about Ocre's capabilities |
| 70 | +- Learn how to create your own container from scratch using the [Ocre Container APIs](../../../reference/container-api) |
0 commit comments