Skip to content

Commit

Permalink
Update getting started with melange to use arch specific instructions (
Browse files Browse the repository at this point in the history
…#887)

* Update getting started with melange to use architecture specific instructions
---------

Signed-off-by: Jamon Camisso <jamonation+git@gmail.com>
  • Loading branch information
jamonation authored Aug 4, 2023
1 parent 6d3742e commit 618fd7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions assets/js/replacer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function makeVarsEditable() {
}

// add a span around variables
let newElem = `<span data-title="test" class="inline-variable">${m[0]}</span>`;
let newElem = `<span data-title="test" title="Click to edit" class="inline-variable">${m[0]}</span>`;
element.innerHTML = element.innerHTML.replace(m[0], newElem);

// make it editable
Expand All @@ -42,4 +42,4 @@ function updateVariable(matchingString, event) {
// meaning and all event listeners are gone
makeVarsEditable();
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,16 @@ The following command will set up a volume sharing your current folder with the
```shell
docker run --rm -v ${PWD}:/work cgr.dev/chainguard/apko \
build apko.yaml hello-minicli:test hello-minicli.tar \
--arch host \
-k melange.rsa.pub
```
This will build an OCI image based on your host system's architecture. If you receive warnings at this point, those are likely related to the types of SBOMs being uploaded and can be safely ignored.
This will build an OCI image based on your host system's architecture (specified by the `--arch host` flag). If you receive warnings at this point, those are likely related to the types of SBOMs being uploaded and can be safely ignored.

The command will generate a few new files in the app's directory:

- `hello-minicli.tar` — the packaged OCI image that can be imported with a `docker load` command
- `sbom-x86_64.cdx` — an SBOM file for `x86_64` architecture in `cdx` format
- `sbom-x86_64.spdx.json` — an SBOM file for `x86_64` architecture in `spdx-json` format
- `sbom-%host-architecture%.cdx` — an SBOM file for your host architecture in `cdx` format
- `sbom-%host-architecture%.spdx.json` — an SBOM file for your host architecture in `spdx-json` format

Next, load your image within Docker:

Expand All @@ -378,12 +379,15 @@ docker load < hello-minicli.tar
```
```
10f951ac3cd2: Loading layer [==================================================>] 7.764MB/7.764MB
Loaded image: hello-minicli:test
Loaded image: hello-minicli:test-%host-architecture%
```
Note that the `%host-architecture%` will vary, and there may be multiple images loaded into your Docker daemon. Be sure to edit the variable in the following `docker run` command to match your target architecture. You can also click to edit it inline on this page.
Now you can run your Minicli program with:
```shell
docker run --rm hello-minicli:test
docker run --rm hello-minicli:test-%host-architecture%
```
The demo should output an advice slip such as:

Expand Down

0 comments on commit 618fd7d

Please sign in to comment.