Skip to content

Commit

Permalink
docs/tutorial: update custom module tutorial with cue mod registry
Browse files Browse the repository at this point in the history
Now that we have an append-only version of cue mod registry, we should
switch to recommending that as the default. Which has the added benefit
of meaning that we can drop a pre-requisite.

However for those more familiar/comfortable with existing
container-based setups, we still recommend docker, and in the spirit of
https://cuelang.org/cl/1177163, we add mention of podman. It might be
that with time we push such "detail" to another document, but for now
it's fine in the modules tutorial.

Preview-Path: /docs/tutorial/working-with-a-custom-module-registry
Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I04de4d35515fa7f4cced881cd70ebe065ffc7093
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1177164
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@gmail.com>
  • Loading branch information
myitcv committed Feb 21, 2024
1 parent 2062618 commit 916ac4f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
22 changes: 17 additions & 5 deletions content/docs/tutorial/working-with-a-custom-module-registry/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ This tutorial describes an experimental feature. All details are subject to chan
- **A command terminal**. `cue` works on all platforms, so any terminal on Linux
or macOS, and on PowerShell, `cmd.exe` or
[WSL](https://learn.microsoft.com/en-us/windows/wsl/install) in Windows.
- **The docker command** or an Open Container Initiative ("OCI") registry that
you can write to.
- **An installed `cue` binary**
([installation details]({{< relref "/docs/introduction/installation" >}}))
- **Some awareness of CUE schemata**
Expand Down Expand Up @@ -152,17 +150,31 @@ it represents the schema of the configuration data expected by `FrostyApp`.
{{{with step}}}

If you do not have access to an OCI registry, start one locally:

{{{with script "en" "start-registry"}}}
#norun

docker run -p 5000:5000 registry
cue mod registry localhost:5000
{{{end}}}

`cue mod registry` is a very simple in-memory OCI server.

CUE should work with all OCI-compatible artifact registries, such as
the [Google Artifact Registry](https://cloud.google.com/artifact-registry),
as CUE uses the standard OCI protocols spoken by such registries.
as CUE uses the standard OCI protocols spoken by such registries. For example,
here are some alternatives:

{{{with script "en" "start-registry alternatives"}}}
#norun

# running a local registry via docker
docker run -p 5000:5000 registry

# running a local registry via podman
podman run -p 5000:5000 registry
{{{end}}}

In our example we will run a local instance of the docker registry on port 5000.
In our example we will run a local instance of the in-memory registry on port 5000.
If you need to run one locally, invoke the above `docker` command in a separate
terminal so the registry remains running while you follow the rest of this
tutorial.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ This tutorial describes an experimental feature. All details are subject to chan
- **A command terminal**. `cue` works on all platforms, so any terminal on Linux
or macOS, and on PowerShell, `cmd.exe` or
[WSL](https://learn.microsoft.com/en-us/windows/wsl/install) in Windows.
- **The docker command** or an Open Container Initiative ("OCI") registry that
you can write to.
- **An installed `cue` binary**
([installation details]({{< relref "/docs/introduction/installation" >}}))
- **Some awareness of CUE schemata**
Expand Down Expand Up @@ -145,15 +143,27 @@ it represents the schema of the configuration data expected by `FrostyApp`.
{{< step stepNumber="4" >}}

If you do not have access to an OCI registry, start one locally:
```text { title="TERMINAL" codeToCopy="ZG9ja2VyIHJ1biAtcCA1MDAwOjUwMDAgcmVnaXN0cnkK" }
$ docker run -p 5000:5000 registry

```text { title="TERMINAL" codeToCopy="Y3VlIG1vZCByZWdpc3RyeSBsb2NhbGhvc3Q6NTAwMAo=" }
$ cue mod registry localhost:5000
```

`cue mod registry` is a very simple in-memory OCI server.

CUE should work with all OCI-compatible artifact registries, such as
the [Google Artifact Registry](https://cloud.google.com/artifact-registry),
as CUE uses the standard OCI protocols spoken by such registries.
as CUE uses the standard OCI protocols spoken by such registries. For example,
here are some alternatives:

```text { title="TERMINAL" codeToCopy="ZG9ja2VyIHJ1biAtcCA1MDAwOjUwMDAgcmVnaXN0cnkKcG9kbWFuIHJ1biAtcCA1MDAwOjUwMDAgcmVnaXN0cnkK" }
# running a local registry via docker
$ docker run -p 5000:5000 registry
# running a local registry via podman
$ podman run -p 5000:5000 registry
```

In our example we will run a local instance of the docker registry on port 5000.
In our example we will run a local instance of the in-memory registry on port 5000.
If you need to run one locally, invoke the above `docker` command in a separate
terminal so the registry remains running while you follow the rest of this
tutorial.
Expand Down

0 comments on commit 916ac4f

Please sign in to comment.