Skip to content

Commit

Permalink
Update Quickstart Docs (#440)
Browse files Browse the repository at this point in the history
* Add initial quickstart content to building from source docs to create draft of quickstart docs

* Add more quickstart docs, add minimal docs for container-only builds

* Rename container-only-builds and some wording updates

* Fix invalid title syntax

* Update sidebars

* Fix broken link

* Update website/docs/quickstart.md

Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>

* Update website/docs/container-only-builds.md

Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>

* Update website/docs/quickstart.md

Co-authored-by: Brian Goff <cpuguy83@gmail.com>

* Address review feedback

---------

Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>
Co-authored-by: Brian Goff <cpuguy83@gmail.com>
  • Loading branch information
3 people authored Nov 27, 2024
1 parent 3834e38 commit a11b46a
Show file tree
Hide file tree
Showing 8 changed files with 267 additions and 199 deletions.
185 changes: 0 additions & 185 deletions website/docs/build-source.md

This file was deleted.

4 changes: 2 additions & 2 deletions website/docs/build.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Building with Dalec
title: Overview
---

In this section, we'll go over how to build packages and containers with Dalec.
Expand All @@ -16,7 +16,7 @@ For more information on the Dalec spec, see the [Dalec Specification](spec.md).

Dalec can build packages and containers from source code repositories. This is done by specifying the source code repository and the build steps in the Dalec spec. The source code is checked out, built, and the resulting artifacts are included in the package.

For more information on building from source, see [Building from source](build-source.md).
For an intro guide to building from source code repos, see [Quickstart](quickstart.md).

## Virtual Packages

Expand Down
33 changes: 33 additions & 0 deletions website/docs/container-only-builds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Container-only builds
---


It is possible to use Dalec when you wish to build a minimal image from scratch or based on one of Dalec's supported distros (see [Targets](targets.md) for a list of these) with only certain packages installed. To do this, simply define a Dalec spec with only runtime dependencies specified. The resulting image will contain only the specified packages and their dependencies.

```yaml
name: my-minimal-image
version: 0.1.0
description: A minimal distroless image with only curl and shell access
revision: 1

dependencies:
runtime:
curl:
bash:

image:
entrypoint: /bin/bash

```

Then, to build:
`docker buildx build -f my-minimal-image.yml --target=mariner2 -t my-minimal-image:0.1.0 .`

This will produce a minimal image from `scratch` with `curl`, `bash`, and just a few other essential packages such as `prebuilt-ca-certificates` and `tzdata`.

How does this work? Dalec will create a [Virtual Package](virtual-packages.md) which has only the specified runtime dependencies and install this in the target base image. This is where the `--target=mariner2` flag comes in. Even though the resulting image is from scratch, it will have the specified packages installed from mariner2 repos.

:::note
Dalec needs to use the [buildx cli](https://github.com/docker/buildx#manual-download) in order to interact with a buildkit builder. In newer versions of docker, `docker build` is an alias for `docker buildx build`, and so the `docker buildx` command can be used interchangeably with `docker build`. However, if unsure or using an old version of docker, use `docker buildx` to ensure compatibility.
:::
2 changes: 1 addition & 1 deletion website/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Our goal is to provide a secure and reproducible way to build packages and conta
- ✍️ Support for signed packages
- 🔐 Ensure supply chain security with build time SBOMs, and Provenance attestations

👉 To get started with building packages and containers, please see [Building with Dalec](build.md)!
👉 To get started with building packages and containers, please see [Quickstart](quickstart.md)!
Loading

0 comments on commit a11b46a

Please sign in to comment.