Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Quickstart Docs #440

Merged
merged 10 commits into from
Nov 27, 2024
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