Skip to content

Commit 8a248cd

Browse files
author
Natalie Arellano
authored
Merge pull request cds-hooks#416 from aemengo/add-arm-docs
Add ARM docs
2 parents dd872fa + 824ac28 commit 8a248cd

File tree

22 files changed

+377
-299
lines changed

22 files changed

+377
-299
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Git Checkout
1919
uses: actions/checkout@v2
2020
- name: Setup Go environment
21-
uses: actions/[email protected].3
21+
uses: actions/[email protected].4
2222
with:
2323
go-version: '1.x'
2424
- name: Install Dependencies
@@ -35,7 +35,7 @@ jobs:
3535
run: |
3636
make check-links
3737
- name: Upload public folder
38-
uses: actions/upload-artifact@v1
38+
uses: actions/upload-artifact@v2.2.4
3939
env:
4040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4141
with:
@@ -48,13 +48,14 @@ jobs:
4848
runs-on: ubuntu-latest
4949
steps:
5050
- name: Download public folder
51-
uses: actions/download-artifact@v1
51+
uses: actions/download-artifact@v2.0.10
5252
with:
5353
name: public
54+
path: ./public
5455
- name: Deploy
5556
uses: peaceiris/actions-gh-pages@v3
5657
with:
5758
github_token: ${{ secrets.GITHUB_TOKEN }}
5859
publish_dir: ./public
5960
cname: buildpacks.io
60-
full_commit_message: ${{ github.event.head_commit.message }}
61+
full_commit_message: ${{ github.event.head_commit.message }}

content/docs/app-developer-guide/build-a-windows-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ summary="The basics of taking your Windows app from source code to runnable imag
66

77
> **EXPERIMENTAL:**
88
>
9-
> - Please note that **Windows container support is currently experimental**. You may be asked to enable experimental features in `pack` when running the following commands. Simply follow the on-screen instructions to do so.
9+
> - Please note that **Windows container support is currently experimental**. You may be asked to enable experimental features in `pack` when running the following commands. Simply follow the on-screen instructions to do so.
1010
> - If you encounter any problems while experimenting, we'd love for you to let us know by filing an issue on the [pack][pack-issues] or [lifecycle][lifecycle-issues] repo.
1111
1212
### Recommended reading

content/docs/app-developer-guide/build-an-app.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ docker run --rm -p 8080:8080 sample-app
5555

5656
The app should now be running and accessible via [localhost:8080](http://localhost:8080).
5757

58+
## What about ARM apps?
59+
60+
Linux ARM image builds are now supported!
61+
62+
<a href="/docs/app-developer-guide/build-an-arm-app" class="button bg-blue">Linux ARM build guide</a>
63+
5864
## What about Windows apps?
5965

6066
Windows image builds are now supported!
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
+++
2+
title="Build an ARM app"
3+
weight=2
4+
summary="The basics of taking your app from source code to runnable ARM image."
5+
+++
6+
7+
As of today, there are no CNB platforms (e.g. [pack][pack]) that support building ARM application images. In the following tutorial, we will be performing a build "manually", in that we will be performing a build by invoking the lifecycle directly.
8+
9+
### 1. Prepare your working directory
10+
11+
On your Linux ARM machine with a [docker][docker] daemon installed, prepare the following directory tree structure.
12+
13+
```bash
14+
tree ~/workspace/
15+
~/workspace/
16+
├── buildpacks
17+
│ └── samples_hello-world
18+
└── platform
19+
```
20+
21+
In addition, clone the [samples][samples] repository which will contain the application source code.
22+
23+
```bash
24+
# clone the repo
25+
git clone https://github.com/buildpacks/samples ~/workspace/samples
26+
```
27+
28+
### 2. Prepare the assets
29+
30+
Now we need to prepare assets that will be used during the build process.
31+
32+
First we download and extract the [lifecycle][lifecycle] release, compiled for ARM. Make sure to replace `<RELEASE-VERSION>` with a valid release version.
33+
34+
```bash
35+
# change to destination directory
36+
cd ~/workspace
37+
38+
# download and extract lifecycle
39+
curl -L https://github.com/buildpacks/lifecycle/releases/download/v<RELEASE-VERSION>/lifecycle-v<RELEASE-VERSION>+linux.arm64.tgz | tar xf -
40+
```
41+
42+
Next we make sure that our buildpack directory is structured in a way that the lifecycle will expect.
43+
44+
```bash
45+
# copy hello-world buildpack
46+
cp -R ~/workspace/samples/buildpacks/hello-world ~/workspace/buildpacks/samples_hello-world/0.0.1
47+
```
48+
49+
And finally we write the `order.toml` file that references the hello-world buildpack.
50+
51+
```bash
52+
cat > ~/workspace/order.toml <EOF
53+
[[order]]
54+
[[order.group]]
55+
id = "samples/hello-world"
56+
version = "0.0.1"
57+
optional = false
58+
EOF
59+
```
60+
61+
### 3. Build your app
62+
63+
Now we can build our app. For this example we will be using the docker CLI to invoke the lifecycle directly.
64+
65+
```bash
66+
# invoke the lifecycle
67+
docker run --rm \
68+
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
69+
--volume ~/workspace/lifecycle:/cnb/lifecycle \
70+
--volume ~/workspace/buildpacks:/cnb/buildpacks \
71+
--volume ~/workspace/samples/apps/bash-script:/workspace \
72+
--volume ~/workspace/platform:/platform \
73+
--mount type=bind,source=~/workspace/order.toml,target=/cnb/order.toml \
74+
--env CNB_PLATFORM_API=0.7 \
75+
ubuntu:bionic \
76+
/cnb/lifecycle/creator -log-level debug -daemon -run-image ubuntu:bionic hello-arm64
77+
```
78+
79+
### 4. Run it
80+
81+
```bash
82+
docker run --rm hello-arm64
83+
```
84+
85+
**Congratulations!**
86+
87+
The app image should now be built and stored on the docker daemon. You may perform `docker images` to verify.
88+
89+
[pack]: https://github.com/buildpacks/pack
90+
[docker]: https://docs.docker.com
91+
[samples]: https://github.com/buildpacks/samples
92+
[lifecycle]: https://github.com/buildpacks/lifecycle

content/docs/app-developer-guide/environment-variables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ The following environment variables were set and available to buildpacks at buil
8787
8888
### Using Project Descriptor
8989
The `--descriptor` parameter must be a path to a file which follows the project.toml [schema][descriptor-schema].
90+
Without the `--descriptor` flag, `pack build` will use the `project.toml` file in the application directory if it exists.
9091
You can define environment variables in an `env` table in the file, and pass those into the application.
9192

9293
##### Example:

content/docs/buildpack-author-guide/create-buildpack/building-blocks-cnb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Let's create the directory where your buildpack will live:
1111

1212
## Using the Pack CLI
1313

14-
The `buildpack new <id>` commmand will create a directory named for the buildpack ID.
14+
The `buildpack new <id>` command will create a directory named for the buildpack ID.
1515

1616
Example:
1717
<!-- test:exec -->

content/docs/buildpack-author-guide/create-buildpack/detection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ weight=403
55

66
<!-- test:suite=create-buildpack;weight=3 -->
77

8-
Next, you will want to actually detect that the app your are building is a Ruby app. In order to do this, you will need to check for a `Gemfile`.
8+
Next, you will want to actually detect that the app you are building is a Ruby app. In order to do this, you will need to check for a `Gemfile`.
99

1010
Replace `exit 1` in the `detect` script with the following check:
1111

@@ -50,7 +50,7 @@ You should see the following output:
5050

5151
Notice that `detect` now passes because there is a valid `Gemfile` in the Ruby app at `ruby-sample-app`, but now `build` fails because it is currently written to error out.
5252

53-
You will also notice that `ANALYZING` now appears in the build output. This steps is part of the buildpack lifecycle that looks to see if any previous image builds have layers that the buildpack can re-use. We will get into this topic in more detail later.
53+
You will also notice that `ANALYZING` now appears in the build output. This step is part of the buildpack lifecycle that looks to see if any previous image builds have layers that the buildpack can re-use. We will get into this topic in more detail later.
5454

5555
---
5656

content/docs/buildpack-author-guide/publish-a-buildpack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pack buildpack register example/my-cnb
2727

2828
This will open GitHub in a browser and may ask you to authenticate with GitHub. After doing so, you'll see a pre-populated GitHub Issue with the details of your buildpack. For example:
2929

30-
<img src="/images/registry-add-buildpack.png" />
30+
<img src="/images/registry-add-buildpack.png" alt="pre-populated GitHub Issue" />
3131

3232
The pre-populated text in the body of the issue is considered structured data, and will be used to automatically add the buildpack to the registry index. Do not change it.
3333

content/docs/buildpack-author-guide/publishing-with-github-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ weight=5
44
summary="Learn how to automatically publish your buildpack to the Buildpack Registry from a Github Action."
55
+++
66

7-
If you would like to publish your buildpack image to the registry without requiring a human click a button in a browser, you can automate the process using the helpers in the [buildpacks/github-actions][github-actions] repository.
7+
If you would like to publish your buildpack image to the registry without requiring a human to click a button in a browser, you can automate the process using the helpers in the [buildpacks/github-actions][github-actions] repository.
88

99
To begin, you must store your buildpack source code in GitHub and [enable GitHub Actions](https://github.com/features/actions). Then create a directory named `.github/workflows` in your repository, and add a file named `release.yml` to it. The `release.yml` workflow can be [triggered](https://docs.github.com/en/actions/reference/events-that-trigger-workflows) in many ways, but it's common to use a Release event as a trigger. To do so, add the following to your `release.yml`:
1010

@@ -75,7 +75,7 @@ Before you execute this GitHub Action, you must add three secrets to your GitHub
7575

7676
After you've created these secrets and pushed your `release.yml` file to GitHub you can trigger the workflow by creating a new Release using the [GitHub Releases UI](https://docs.github.com/en/github/administering-a-repository/about-releases).
7777

78-
From [GitHub.com](https://github.com), click on _Your Repositories_, then click the _Packages_ tab and look for the image you just created. Click it and then select _Package Settings_. From this page, click the button to make this package public, and confirm the name of the image when promoted.
78+
From [GitHub.com](https://github.com), click on _Your Repositories_, then click the _Packages_ tab and look for the image you just created. Click it and then select _Package Settings_. From this page, click the button to make this package public, and confirm the name of the image when prompted.
7979

8080
Push the `release.yml` changes to GitHub and trigger a new release. The workflow will create a GitHub Issue on the Buildpack Registry and your buildpack will be added to the index.
8181

content/docs/concepts/components/buildpack-group.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ A [builder][builder] or [meta-buildpack][meta-buildpack] may contain multiple bu
2424

2525
For example, if a builder has buildpack groups A, B and C. The lifecycle will run detection against A. If all of the non-optional buildpacks in that group pass detection, then it will select A. In that case, B and C will not be processed. If A has any failing non-optional buildpacks, then the lifecycle will move on to process buildpack group B. If B has any failing non-optional buildpacks, then the lifecycle will move on to process buildpack group C. If C fails, then the entire detection process will fail.
2626

27-
If a buildpack group contains meta-buildpacks, which in turn may contain more buildpack groups those are expanded using [the order resolution rules][order-resolution] such that each buildpack group in the meta-buildpack is tried with the other buildpacks in the containg buildpack group.
27+
If a buildpack group contains meta-buildpacks, which in turn may contain more buildpack groups those are expanded using [the order resolution rules][order-resolution] such that each buildpack group in the meta-buildpack is tried with the other buildpacks in the containing buildpack group.
2828

2929
For example:
3030

0 commit comments

Comments
 (0)