Skip to content

Commit

Permalink
Merge pull request #993 from chainguard-dev/move-getting-started
Browse files Browse the repository at this point in the history
Move Getting Started guides + reorganize menu
  • Loading branch information
erikaheidi authored Sep 11, 2023
2 parents b85a98d + 8f6025a commit 22fe43b
Show file tree
Hide file tree
Showing 23 changed files with 86 additions and 54 deletions.
4 changes: 2 additions & 2 deletions content/chainguard/chainguard-images/comparing-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ images: []
menu:
docs:
parent: "chainguard-images"
weight: 400
weight: 700
toc: true
---

Expand Down Expand Up @@ -143,4 +143,4 @@ Another potential use could be in cases where you're interested in knowing the d
## Learn more

To learn more about the `chainctl image` subcommands, we encourage you to check out our
[`chainctl` command resources](/chainguard/chainctl/chainctl-docs/chainctl_images/). You can also explore the rest of our [Chainguard Images resources](/chainguard/chainguard-images/) to learn more about how Images can help you keep your software secure by default.
[`chainctl` command resources](/chainguard/chainctl/chainctl-docs/chainctl_images/). You can also explore the rest of our [Chainguard Images resources](/chainguard/chainguard-images/) to learn more about how Images can help you keep your software secure by default.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ images: []
menu:
docs:
parent: "chainguard-images"
weight: 800
weight: 750
toc: true
---

Expand Down
12 changes: 6 additions & 6 deletions content/chainguard/chainguard-images/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ images: []
menu:
docs:
parent: "chainguard-images"
weight: 500
weight: 900
toc: true
---

Expand All @@ -36,15 +36,15 @@ We call Wolfi an undistro because unlike a typical Linux distribution, Wolfi is

There are currently over 100 Chainguard Images available, which are segmented in [three catalog tiers](#what-are-the-different-catalog-tiers-of-chainguard-images). You can read more about the tiers in the [next question](#what-are-the-different-catalog-tiers-of-chainguard-images).

Our full Images Catalog is available on the Chainguard Console at [https://console.enforce.dev/images/catalog](https://console.enforce.dev/images/catalog) (you will need to be logged in).
Our full Images Catalog is available on the Chainguard Console at [https://console.enforce.dev/images/catalog](https://console.enforce.dev/images/catalog) (you will need to be logged in).

To review our public catalog, you can check out either the [Chainguard Images Reference Docs](https://edu.chainguard.dev/chainguard/chainguard-images/reference/) or the [GitHub Repository](https://github.com/chainguard-images).

Chainguard Images are available through the [Chainguard Registry](/chainguard/chainguard-images/registry/overview/).

## What are the different catalog tiers of Chainguard Images?

The Public Chainguard Images Catalog is available at no cost to users. Our paid catalogs currently include Standard and Custom subscription tiers, featuring enterprise-grade patching SLAs and customer support.
The Public Chainguard Images Catalog is available at no cost to users. Our paid catalogs currently include Standard and Custom subscription tiers, featuring enterprise-grade patching SLAs and customer support.

The **Public Catalog** includes no cost access to the latest version of all images from applications and middleware, development and build tools and language runtimes.

Expand All @@ -57,7 +57,7 @@ Review the comparison table below for additional information about our catalog t
Catalog | Public Catalog | Standard Catalog | Custom Catalog
--------|----------------|------------------|---------------
**Versions** | `:latest`, `:latest-dev`, and images by digest | All upstream supported version tags including ``:latest`` and ``:latest-dev`` | All upstream supported version tags including ``:latest`` and ``:latest-dev``, plus end-of-life versions
**Image Signatures** | Yes | Yes | Yes
**Image Signatures** | Yes | Yes | Yes
**SBOMS and Attestations** | Yes | Yes | Yes
**SLSA Provenance** | Build Level 2 | Build Level 2 | Build Level 2
**Notifications** | Only when logged in, via email | Yes, webhook and email | Yes, webhook and email
Expand All @@ -82,10 +82,10 @@ Chainguard Images are designed to be minimalist, and many of them are distroless
Chainguard Images are rebuilt every night to ensure that new package versions and security updates in upstream Wolfi are quickly applied.

## Do I need to authenticate into Chainguard to use Chainguard Images?
Logging in is optional if you are only using `:latest` and `:latest-dev` tags or image digests.
Logging in is optional if you are only using `:latest` and `:latest-dev` tags or image digests.

As of August 16, 2023, all other tags for Chainguard Images in the Public catalog are unavailable without paying for access to the Standard or Custom catalogs. This means that Public catalog users, including open source projects, will either need to pin to the digest they currently use, migrate to the software version associated with `:latest`, or build upon [wolfi-base](/chainguard/chainguard-images/reference/wolfi-base/) to build their desired image.

There are benefits for all users who authenticate to the Chainguard Registry, as Chainguard provides notifications of version updates, breaking changes, or critical security updates. However, users can continue to pull Images by digest or Images tagged `:latest` anonymously.
There are benefits for all users who authenticate to the Chainguard Registry, as Chainguard provides notifications of version updates, breaking changes, or critical security updates. However, users can continue to pull Images by digest or Images tagged `:latest` anonymously.

To learn how to authenticate into the Chainguard Registry, you can review our [authentication documentation](/chainguard/chainguard-images/registry/authenticating/). You can read more about our Images catalogs and some of the thought process behind authentication in our blog post, [Scaling Chainguard Images with a growing catalog and proactive security updates](https://www.chainguard.dev/unchained/scaling-chainguard-images-with-a-growing-catalog-and-proactive-security-updates). You can read about the August 16, 2023 changes in the [Important updates for Chainguard Images public catalog users](https://www.chainguard.dev/unchained/important-updates-for-chainguard-images-public-catalog-users) blog post.
13 changes: 13 additions & 0 deletions content/chainguard/chainguard-images/getting-started/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: "Getting Started with Chainguard Images"
linktitle: "Getting Started Guides"
description: "Tutorials on how to get started with Chainguard Images"
type: "article"
date: 2023-09-10T08:49:15+00:00
lastmod: 2023-09-10T08:49:15+00:00
draft: false
images: []
weight: 430
---

Chainguard Images Tutorials
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
---
title: "Getting Started with the Go Chainguard Image"
type: "article"
linktitle: "Go"
description: "Tutorial on the distroless Go Chainguard Image"
date: 2023-02-28T11:07:52+02:00
lastmod: 2023-02-28T11:07:52+02:00
draft: false
images: []
menu:
docs:
parent: "go-guides"
parent: "getting-started"
weight: 610
toc: true
---

The Go images based on Wolfi and maintained by Chainguard provide distroless images that are suitable for building Go workloads.

Chainguard offers a minimal runtime image designed for running Go workloads, and a development image that contains a shell and the standard Go build tooling.
Chainguard offers a minimal runtime image designed for running Go workloads, and a development image that contains a shell and the standard Go build tooling.

We'll demonstrate two ways that you can build the Go image. The [first example](#example-1-minimal-go-chainguard-image-built-with-ko) will show how to build the Go Chainguard Image with [ko](https://ko.build/). ko enables you to build images from Go programs and push them to container registries without requiring a Dockerfile. The [second example](#example-2--multistage-docker-build-for-go-chainguard-image) will show how to create a [multi-stage Docker build](https://docs.docker.com/build/building/multi-stage/) that uses the [glibc-dynamic runtime image](/chainguard/chainguard-images/reference/glibc-dynamic/overview/) along with the Go Chainguard Image.

Expand Down Expand Up @@ -48,7 +49,7 @@ First, create a directory for your app. You can use any meaningful name and path
mkdir ~/go-digester/ && cd $_
```

Next, initialize your app by creating a new module and installing dependencies.
Next, initialize your app by creating a new module and installing dependencies.

```shell
go mod init go-digester
Expand Down Expand Up @@ -106,7 +107,7 @@ With the program running as expected, you're ready to move onto either or both e

## Example 1 — Minimal Go Chainguard Image Built with ko

In this example, we'll build a distroless Go Chainguard Image with ko from the demo app we created in the [prerequisite step](#prerequisite--setting-up-a-demo-application-in-go).
In this example, we'll build a distroless Go Chainguard Image with ko from the demo app we created in the [prerequisite step](#prerequisite--setting-up-a-demo-application-in-go).

ko offers fast container image builds for Go applications. It builds images by executing `go build` on your local machine, and because of this, you are not required to have Docker installed to build the image. Additionally, ko produces [SBOMs](/open-source/sbom/what-is-an-sbom/) by default, supporting a holistic approach to software security.

Expand Down Expand Up @@ -153,7 +154,7 @@ Now that you have built the Go Chainguard Image with ko, you can continue onto [

Because Go applications are compiled and the toolchain is not typically required in a runtime image, we suggest the usage of a [multi-stage Docker build](https://docs.docker.com/build/building/multi-stage/) that uses the [glibc-dynamic runtime image](/chainguard/chainguard-images/reference/glibc-dynamic/overview/). In some cases, the [static image](/chainguard/chainguard-images/reference/static/overview/) may be used as well for an even smaller image, but extra care must be taken to ensure the Go binary is statically-compiled.

For this multi-stage build, we'll use two `FROM` lines in our Dockerfile. To create this Dockerfile, you can use any code editor of your choice, we'll use Nano for demonstation purposes.
For this multi-stage build, we'll use two `FROM` lines in our Dockerfile. To create this Dockerfile, you can use any code editor of your choice, we'll use Nano for demonstation purposes.

```shell
nano Dockerfile
Expand All @@ -168,7 +169,7 @@ The following Dockerfile will:

```Dockerfile
FROM cgr.dev/chainguard/go AS builder
COPY . /app
COPY ../reference/go /app
RUN cd /app && go build -o go-digester .

FROM cgr.dev/chainguard/glibc-dynamic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
---
title: "Getting Started with the MariaDB Chainguard Image"
type: "article"
linktitle: "MariaDB"
lead: "Tutorial on how to get started with the MariaDB Chainguard Image"
date: 2023-07-28T11:07:52+02:00
lastmod: 2023-08-10T11:07:52+02:00
draft: false
images: []
menu:
docs:
parent: "mariadb-guides"
parent: "getting-started"
weight: 610
toc: true
---

The MariaDB Image based on Wolfi and maintained by Chainguard provide a distroless container Image that is suitable for building and running MariaDB workloads.

Because Chainguard Images (including the MariaDB image) are rebuilt daily with the latest sources and include the absolute minimum of dependencies, they have significantly less vulnerabilities than equivalent images, typically zero. This means you can use the Chainguard MariaDB Image to run MariaDB databases in containerized environments with a smaller footprint and greater security.
Because Chainguard Images (including the MariaDB image) are rebuilt daily with the latest sources and include the absolute minimum of dependencies, they have significantly less vulnerabilities than equivalent images, typically zero. This means you can use the Chainguard MariaDB Image to run MariaDB databases in containerized environments with a smaller footprint and greater security.

In order to illustrate how the MariaDB Chainguard Image might be used in practice, this tutorial involves setting up an example PHP application that uses a MariaDB database. This guide assumes you have Docker installed to run the demo; specifically, the procedure outlined in this guide uses [Docker Compose](https://docs.docker.com/compose/install/) to manage the environment on your local machine.

Expand Down Expand Up @@ -102,7 +103,7 @@ docker compose up -d

The `-d` option is short for `--detach`; this will cause the containers to run in the background, allowing you to continue using the same terminal window. If you run into permissions issues when running this command, try running it again with `sudo` privileges.

> **Note**: If at any point you'd like to stop and remove these containers, run `docker compose down`.
> **Note**: If at any point you'd like to stop and remove these containers, run `docker compose down`.
Once all the containers have started, you'll be able to visit the application and observe it working. Open up your preferred web browser and navigate to `localhost:8000`. There, you'll be presented with text like the following.

Expand Down Expand Up @@ -188,4 +189,4 @@ Of course, you likely won't be regularly managing your containerized databases o

## Advanced Usage

{{< blurb/images-advanced image="MariaDB" >}}
{{< blurb/images-advanced image="MariaDB" >}}
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
title: "Getting Started with the Node Chainguard Image"
type: "article"
linktitle: "Node"
description: "Tutorial on how to get started with the Node Chainguard Image"
date: 2023-02-01T11:07:52+02:00
lastmod: 2023-02-01T11:07:52+02:00
draft: false
images: []
menu:
docs:
parent: "node-guides"
parent: "getting-started"
weight: 610
toc: true
---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
title: "Getting Started with the PHP Chainguard Image"
type: "article"
linktitle: "PHP"
description: "Tutorial on how to get started with the PHP Chainguard Image"
date: 2023-01-09T11:07:52+02:00
lastmod: 2023-01-19T11:07:52+02:00
draft: false
images: []
menu:
docs:
parent: "php-guides"
parent: "getting-started"
weight: 610
toc: true
---
Expand Down Expand Up @@ -163,7 +164,7 @@ Copy this content to your own `Dockerfile`:
```Dockerfile
FROM cgr.dev/chainguard/php:latest-dev AS builder
USER root
COPY . /app
COPY ../reference/php /app
RUN chown -R php /app
USER php
RUN cd /app && \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
---
title: "Getting Started with the PostgreSQL Chainguard Image"
type: "article"
linktitle: "PostgreSQL"
lead: "Tutorial on how to get started with the PostgreSQL Chainguard Image"
date: 2023-08-10T11:07:52+02:00
lastmod: 2023-08-10T11:07:52+02:00
draft: false
images: []
menu:
docs:
parent: "postgres-guides"
parent: "getting-started"
weight: 610
toc: true
---

PostgreSQL — commonly known as "Postgres" — is a popular open-source relational database. The PostgreSQL Images based on Wolfi and maintained by Chainguard provide distroless Images that are suitable for building and running PostgreSQL workloads.

Because Chainguard Images (including the PostgreSQL image) are rebuilt daily with the latest sources and include the absolute minimum of dependencies, they have significantly fewer vulnerabilities than equivalent images, typically zero. This means you can use the Chainguard PostgreSQL Image to run Postgres databases in containerized environments with a smaller footprint and greater security.
Because Chainguard Images (including the PostgreSQL image) are rebuilt daily with the latest sources and include the absolute minimum of dependencies, they have significantly fewer vulnerabilities than equivalent images, typically zero. This means you can use the Chainguard PostgreSQL Image to run Postgres databases in containerized environments with a smaller footprint and greater security.

In order to illustrate how the PostgreSQL Chainguard Image might be used in practice, this tutorial involves setting up an example PHP application that uses a Postgres database. This guide assumes you have Docker installed to run the demo; specifically, the procedure outlined in this guide uses [Docker Compose](https://docs.docker.com/compose/install/) to manage the environment on your local machine.

Expand Down Expand Up @@ -88,7 +89,7 @@ Once the environment is up, you can visit the demo in your web browser. The `ind

Every time you reload the page, a new entry will be added to the table.

Note that this application includes a Dockerfile.
Note that this application includes a Dockerfile.

```sh
cat Dockerfile
Expand All @@ -102,7 +103,7 @@ RUN apk update && apk add php-pgsql
USER php
```

This Dockerfile takes the public `php:latest-fpm-dev` Chainguard Image and installs the `php-pgsql` package onto it. This image comes with drivers that allow PHP applications to connect to MySQL or MariaDB databases by default but it doesn't have an equivalent for PostgreSQL. For this reason, we use this Dockerfile to install this package in order for the PHP application to be able to connect to the Postgres database.
This Dockerfile takes the public `php:latest-fpm-dev` Chainguard Image and installs the `php-pgsql` package onto it. This image comes with drivers that allow PHP applications to connect to MySQL or MariaDB databases by default but it doesn't have an equivalent for PostgreSQL. For this reason, we use this Dockerfile to install this package in order for the PHP application to be able to connect to the Postgres database.

Execute the following command to build an image with this Dockerfile, and then create and start each of the three containers and bring up the application.

Expand All @@ -112,11 +113,11 @@ docker compose up -d

The `-d` option is short for `--detach`; this will cause the containers to run in the background, allowing you to continue using the same terminal window. If you run into permissions issues when running this command, try running it again with `sudo` privileges.

> **Note**: If at any point you'd like to stop and remove these containers, run `docker compose down`.
> **Note**: If at any point you'd like to stop and remove these containers, run `docker compose down`.
Once all the containers have started, you'll be able to visit the application and observe it working. Open up your preferred web browser and navigate to `localhost:8000`. There, you'll be presented with text like the following

![Screenshot showing a Firefox web browser window with "localhost:8000" in the address bar. On the page is the following text: "Array ( [data_key] => code [data_value] => 8404 )"](pg-demo-success-1.png)
![Screenshot showing a Firefox web browser window with "localhost:8000" in the address bar. On the page is the following text: "Array ( [data_key] => code [data_value] => 8404 )"](pg-demo-success-1.png)

Every time you refresh your browser, a new entry will appear.

Expand Down
Loading

0 comments on commit 22fe43b

Please sign in to comment.