You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cf29cc8
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+40-35Lines changed: 40 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,49 +2,57 @@
2
2
3
3
`apt-transport-oci` is an `apt-get` plugin to support distributing `*.deb` packages over an OCI registry such as `ghcr.io` .
4
4
5
+
> [!NOTE]
6
+
> "OCI" here refers to the "[Open Container Initiative](https://opencontainers.org/)", not to the "Oracle Cloud Infrastructure".
7
+
5
8
## Motivation
6
9
The motivation is to distribute `*.deb` packages without running a web server but using a popular fully-managed service such as `ghcr.io`.
7
10
8
11
If GitHub could offer fully-managed apt repo, this plugin wouldn't be needed.
9
12
10
-
## Usage
11
13
12
-
- Install the `apt-transport-oci` plugin onto `/usr/lib/apt/methods/oci`:
14
+
## Install
15
+
The `apt-transport-oci` plugin is officially [packaged](https://repology.org/project/apt-transport-oci/versions) in Debian and Ubuntu,
16
+
since Debian 14 and Ubuntu 26.04.
17
+
18
+
```bash
19
+
sudo apt install apt-transport-oci
13
20
```
21
+
22
+
<details><summary>Build from source</summary>
23
+
<p>
24
+
25
+
```bash
14
26
sudo go build -o /usr/lib/apt/methods/oci ./cmd/usr-lib-apt-methods-oci
15
27
```
16
28
17
-
- Create `/etc/apt/sources.list.d/oci.list` with the following content to enable [`oci://ghcr.io/akihirosuda/hello-apt-transport-oci`](https://ghcr.io/akihirosuda/hello-apt-transport-oci) repo:
29
+
</p>
30
+
</details>
31
+
32
+
## Example
33
+
The following example installs the `hello-apt-transport-oci` package from the [`oci://ghcr.io/akihirosuda/hello-apt-transport-oci`](https://ghcr.io/akihirosuda/hello-apt-transport-oci) repo.
34
+
35
+
> [!TIP]
36
+
> See [`./examples`](./examples) for how to build and push this package to your own registry.
37
+
38
+
- Create `/etc/apt/sources.list.d/oci.sources` with the following content:
18
39
```
19
-
deb [trusted=yes] oci://ghcr.io/akihirosuda/hello-apt-transport-oci:latest /
(Reading database ... 249739 files and directories currently installed.)
45
-
Preparing to unpack .../hello-apt-transport-oci_0.0_amd64.deb ...
46
-
Unpacking hello-apt-transport-oci (0.0) ...
47
-
Setting up hello-apt-transport-oci (0.0) ...
52
+
- Run:
53
+
```bash
54
+
sudo apt update
55
+
sudo apt install hello-apt-transport-oci
48
56
```
49
57
50
58
- Make sure `hello-apt-transport-oci` is installed
@@ -53,19 +61,16 @@ $ hello-apt-transport-oci
53
61
Hello, apt-transport-oci
54
62
```
55
63
56
-
###Hints
64
+
## Hints
57
65
- Create `/root/.docker/config.json` to enable authentication.
58
66
- Non-TLS registry is supported only for 127.0.0.1
59
67
- Troubleshooting: Run `apt-get -o Debug::pkgAcquire::Worker=1 update 2>&1` and grep `FailReason`
60
68
61
-
## Creating an apt repo
62
-
See [`./examples`](./examples) .
63
-
64
69
## Specification
65
-
The spec corresponds to the behavior of `oras push IMAGE FILE1:application/octet-stream FILE2:application/octet-stream ...` (ORAS v0.12).
70
+
The spec corresponds to the behavior of `oras push --image-spec=v1.0 IMAGE FILE1:application/octet-stream FILE2:application/octet-stream ...`.
66
71
67
72
- An image index MAY have multiple manifests, but all the manifests SHOULD refer to the same set of layers (because `apt-get` itself supports multi-arch repo).
68
73
- A layer MUST have `org.opencontainers.image.title` annotation that corresponds to the file name.
69
74
- A layer SHOULD have one of the following media types:
0 commit comments