Skip to content

Latest commit

 

History

History
93 lines (55 loc) · 2.8 KB

first-time-build.md

File metadata and controls

93 lines (55 loc) · 2.8 KB

Build Your First Zarf

Creating a Zarf release is a two-stage process:

  1. Build the zarf binaries.
  2. Build the zarf distribution package.

Usually (during development) these two stages are accomplished with a single command, but doing so requires that you already have a copy of zarf installed; that won't be the case the first time you try to build Zarf on a fresh, development workstation.

To get a new workstation setup for that single-command workflow, see below!

 

1. Build the CLI

The first step toward Zarf development is to getting yourself a set of zarf binaries. You can build them like so:

make build-cli

This command creates a ./build directory and dumps the various zarf binaries into it.

 

2. Log into Iron Bank

Zarf distribution packages are built on top of images from Platform One's container image repository, Iron Bank. To access them, you'll need to 1) secure Iron Bank pull credentials, and 2) configure Zarf to use them.

To use your new Zarf binaries to authenticate with Iron Bank:

  1. Move into the binary build directory:

    cd ./build
  2. Follow the instructions you find here: Zarf Login.

    Take note

    Your credentials are cached in a file on your development machine so you should only need to do this login step once!

  3. Finally, move back "up" to the project root:

    cd ..

And with that, you're ready to build your first Zarf distribution package.

 

3. Build the distribution package

The command to build your first Zarf distribution package looks like this:

make init-package

Build failed?

If your build fails with a message like this:

WARN[0010] Unable to pull the image   image="registry1.dso.mil/[...]"

It is likely that you've forgotten to setup access to Iron Bank or that your credentials have changed. In either case, you should go back through the steps to Log into Iron Bank & try to build again!

Assuming everything works out, you should see a shiny new zarf-init-<arch>.tar.zst in your ./build directory.

Congratulations! You've just built yourself a Zarf!

 

∞. Happily ever after

After you've worked your way through steps 1-3 above you can use a simpler, single command to create a Zarf release:

make build-test

This will use the credentials you established above to dump a fresh set of binaries + distribution package into your ./build directory—an easy to use, simple to remember tool for your Zarf dev & test toolbox!

 

Next steps

Now that you can build your own Zarf, it's a great time to try using it to run our Get Started - game example!