Skip to content

Commit 753f8a8

Browse files
authored
docs: improve README.md (#950)
1. Add a `README.md` file for the `docs` directory 2. Refine the `README.md` file for the project - Add a brief introduction for the repo - Add more documentation links - Reorganize 3. Add explanation about tag update in `docs/Targets.md` Resolve: #813 Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
1 parent 5043a7b commit 753f8a8

File tree

3 files changed

+75
-34
lines changed

3 files changed

+75
-34
lines changed

README.md

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,66 @@
11
# ORAS Go library
22

3+
[![Build Status](https://github.com/oras-project/oras-go/actions/workflows/build.yml/badge.svg?event=push&branch=main)](https://github.com/oras-project/oras-go/actions/workflows/build.yml?query=workflow%3Abuild+event%3Apush+branch%3Amain)
4+
[![codecov](https://codecov.io/gh/oras-project/oras-go/branch/main/graph/badge.svg)](https://codecov.io/gh/oras-project/oras-go)
5+
[![Go Report Card](https://goreportcard.com/badge/oras.land/oras-go/v2)](https://goreportcard.com/report/oras.land/oras-go/v2)
6+
[![Go Reference](https://pkg.go.dev/badge/oras.land/oras-go/v2.svg)](https://pkg.go.dev/oras.land/oras-go/v2)
7+
38
<p align="left">
4-
<a href="https://oras.land/"><img src="https://oras.land/img/oras.svg" alt="banner" width="100px"></a>
9+
<a href="https://oras.land/"><img src="https://oras.land/img/oras.svg" alt="ORAS logo" width="100px"></a>
510
</p>
611

7-
## Project status
12+
`oras-go` is a Go library for managing OCI artifacts, compliant with the [OCI Image Format Specification](https://github.com/opencontainers/image-spec) and the [OCI Distribution Specification](https://github.com/opencontainers/distribution-spec). It provides unified APIs for pushing, pulling, and managing artifacts across OCI-compliant registries, local file systems, and in-memory stores.
813

9-
### Versioning
14+
> [!Note]
15+
> The `main` branch follows [Go's Security Policy](https://github.com/golang/go/security/policy) and supports the two latest versions of Go (currently `1.23` and `1.24`).
1016
11-
The ORAS Go library follows [Semantic Versioning](https://semver.org/), where breaking changes are reserved for MAJOR releases, and MINOR and PATCH releases must be 100% backwards compatible.
17+
## Getting Started
1218

13-
### v2: stable
19+
### Concepts
1420

15-
[![Build Status](https://github.com/oras-project/oras-go/actions/workflows/build.yml/badge.svg?event=push&branch=main)](https://github.com/oras-project/oras-go/actions/workflows/build.yml?query=workflow%3Abuild+event%3Apush+branch%3Amain)
16-
[![codecov](https://codecov.io/gh/oras-project/oras-go/branch/main/graph/badge.svg)](https://codecov.io/gh/oras-project/oras-go)
17-
[![Go Report Card](https://goreportcard.com/badge/oras.land/oras-go/v2)](https://goreportcard.com/report/oras.land/oras-go/v2)
18-
[![Go Reference](https://pkg.go.dev/badge/oras.land/oras-go/v2.svg)](https://pkg.go.dev/oras.land/oras-go/v2)
21+
Gain insights into the fundamental concepts:
1922

20-
The version `2` is actively developed in the [`main`](https://github.com/oras-project/oras-go/tree/main) branch with all new features.
23+
- [Modeling Artifacts](docs/Modeling-Artifacts.md)
24+
- [Targets and Content Stores](docs/Targets.md)
2125

22-
> [!Note]
23-
> The `main` branch follows [Go's Security Policy](https://github.com/golang/go/security/policy) and supports the two latest versions of Go (currently `1.23` and `1.24`).
26+
### Quickstart
27+
28+
Follow the step-by-step tutorial to use `oras-go` v2:
29+
30+
- [Quickstart: Managing OCI Artifacts with `oras-go` v2](docs/tutorial/quickstart.md)
31+
32+
### Examples
2433

25-
Examples for common use cases can be found below:
34+
Check out sample code for common use cases:
2635

27-
- [Copy examples](https://pkg.go.dev/oras.land/oras-go/v2#pkg-examples)
28-
- [Registry interaction examples](https://pkg.go.dev/oras.land/oras-go/v2/registry#pkg-examples)
29-
- [Repository interaction examples](https://pkg.go.dev/oras.land/oras-go/v2/registry/remote#pkg-examples)
30-
- [Authentication examples](https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/auth#pkg-examples)
36+
- [Artifact copying](https://pkg.go.dev/oras.land/oras-go/v2#pkg-examples)
37+
- [Registry operations](https://pkg.go.dev/oras.land/oras-go/v2/registry#pkg-examples)
38+
- [Repository operations](https://pkg.go.dev/oras.land/oras-go/v2/registry/remote#pkg-examples)
39+
- [Authentication](https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/auth#pkg-examples)
40+
- [Credentials management](https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#pkg-examples)
3141

32-
If you are seeking latest changes, you should use the [`main`](https://github.com/oras-project/oras-go/tree/main) branch (or a specific commit hash) over a tagged version when including the ORAS Go library in your project's `go.mod`.
33-
The Go Reference for the `main` branch is available [here](https://pkg.go.dev/oras.land/oras-go/v2@main).
42+
Find more API examples at [pkg.go.dev](https://pkg.go.dev/oras.land/oras-go/v2).
3443

35-
To migrate from `v1` to `v2`, see [MIGRATION_GUIDE.md](./MIGRATION_GUIDE.md).
3644

37-
### v1: stable
45+
## Versioning
46+
47+
This project follows [Semantic Versioning](https://semver.org/) (`MAJOR`.`MINOR`.`PATCH`), with `MAJOR` for breaking changes, `MINOR` for backward-compatible features, and `PATCH` for backward-compatible fixes.
48+
49+
## Previous Major Versions
50+
51+
### v1 (maintenance)
3852

3953
[![Build Status](https://github.com/oras-project/oras-go/actions/workflows/build.yml/badge.svg?event=push&branch=v1)](https://github.com/oras-project/oras-go/actions/workflows/build.yml?query=workflow%3Abuild+event%3Apush+branch%3Av1)
4054
[![Go Report Card](https://goreportcard.com/badge/oras.land/oras-go)](https://goreportcard.com/report/oras.land/oras-go)
4155
[![Go Reference](https://pkg.go.dev/badge/oras.land/oras-go.svg)](https://pkg.go.dev/oras.land/oras-go)
4256

43-
As there are various stable projects depending on the ORAS Go library `v1`, the
44-
[`v1`](https://github.com/oras-project/oras-go/tree/v1) branch
45-
is maintained for API stability, dependency updates, and security patches.
46-
All `v1.*` releases are based upon this branch.
47-
48-
Since `v1` is in a maintenance state, you are highly encouraged
49-
to use releases with major version `2` for new features.
50-
51-
## Docs
57+
The [`v1`](https://github.com/oras-project/oras-go/tree/v1) branch is maintained for dependency updates and security fixes only. All feature development happens in the [`main`](https://github.com/oras-project/oras-go/tree/main) branch.
5258

53-
- [oras.land/client_libraries/go](https://oras.land/docs/Client_Libraries/go): Documentation for the ORAS Go library
54-
- [Reviewing guide](https://github.com/oras-project/community/blob/main/REVIEWING.md): All reviewers must read the reviewing guide and agree to follow the project review guidelines.
59+
To migrate from `v1` to `v2`, see [MIGRATION_GUIDE.md](MIGRATION_GUIDE.md).
5560

56-
## Code of Conduct
61+
## Community
5762

58-
This project has adopted the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for further details.
63+
- Code of Conduct: [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
64+
- Security Policy: [SECURITY.md](SECURITY.md)
65+
- Reviewing Guide: [Reviewing Guide](https://github.com/oras-project/community/blob/main/REVIEWING.md)
66+
- Slack: [`#oras`](https://cloud-native.slack.com/archives/CJ1KHJM5Z) channel on CNCF Slack

docs/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# `oras-go` v2 Documentation
2+
3+
This directory contains the fundamentals and a quickstart tutorial for `oras-go` v2.
4+
5+
## Fundamentals
6+
7+
It is highly recommended to read the following documentation in order:
8+
9+
- [Modeling Artifacts](./Modeling-Artifacts.md)
10+
- [Targets and Content Stores in `oras-go` v2](./Targets.md)
11+
12+
## Quickstart Tutorial
13+
14+
- [Quickstart: Managing OCI Artifacts with `oras-go` v2](./tutorial/quickstart.md)
15+
16+
For more information about the ORAS project, visit the [ORAS website](https://oras.land/).

docs/Targets.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,23 @@ TagBar>"Tag: bar"]-.->M0
122122
TagV1>"Tag: v1"]-.->M0
123123
```
124124

125+
A descriptor can have multiple tags, but each tag is associated with only one descriptor. Reusing a tag for a different descriptor removes its previous association.
126+
127+
If the tag `"bar"` is reused on another manifest `m1`, the graph would update as follows:
128+
129+
```mermaid
130+
graph TD;
131+
132+
M0["Manifest m0"]--config-->Blob0["Blob b0"]
133+
M0--layers-->Blob1["Blob b1"]
134+
M0--layers-->Blob2["Blob b2"]
135+
M1["Manifest m1"]
136+
137+
TagFoo>"Tag: foo"]-.->M0
138+
TagV1>"Tag: v1"]-.->M0
139+
TagBar>"Tag: bar"]-.->M1
140+
```
141+
125142
### GraphTarget
126143

127144
The [`GraphTarget`](https://pkg.go.dev/oras.land/oras-go/v2#GraphTarget) interface combines the capabilities of [`GraphStorage`](#graphstorage) and [`Target`](#target). It provides the following functions:

0 commit comments

Comments
 (0)