OCI transport plugin for apt-get (i.e., apt-get over ghcr.io)

Overview

apt-transport-oci: OCI transport plugin for apt-get (i.e., apt-get over ghcr.io)

apt-transport-oci is an apt-get plugin to support distributing *.deb packages over an OCI registry such as ghcr.io .

Motivation

The motivation is to distribute *.deb packages without running a web server but using a popular fully-managed service such as ghcr.io.

If GitHub could offer fully-managed apt repo, this plugin wouldn't be needed.

Usage

  • Install the apt-transport-oci plugin onto /usr/lib/apt/methods/oci:
sudo go build -o /usr/lib/apt/methods/oci ./cmd/usr-lib-apt-methods-oci
deb [trusted=yes] oci://ghcr.io/akihirosuda/hello-apt-transport-oci:latest /
  • Run sudo apt-get update && sudo apt-get install hello-apt-transport-oci
$ sudo apt-get update
...
Get:7 oci://ghcr.io/akihirosuda/hello-apt-transport-oci:latest  Packages [478 B]
...
Reading package lists... Done
$ sudo apt-get install hello-apt-transport-oci
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  hello-apt-transport-oci
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 1,106 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 oci://ghcr.io/akihirosuda/hello-apt-transport-oci:latest  hello-apt-transport-oci 0.0 [1,106 B]
Selecting previously unselected package hello-apt-transport-oci.
(Reading database ... 249739 files and directories currently installed.)
Preparing to unpack .../hello-apt-transport-oci_0.0_amd64.deb ...
Unpacking hello-apt-transport-oci (0.0) ...
Setting up hello-apt-transport-oci (0.0) ...
  • Make sure hello-apt-transport-oci is installed
$ hello-apt-transport-oci
Hello, apt-transport-oci

Hints

  • Create /root/.docker/config.json to enable authentication.
  • Non-TLS registry is supported only for 127.0.0.1
  • Troubleshooting: Run apt-get -o Debug::pkgAcquire::Worker=1 update 2>&1 and grep FailReason

Creating an apt repo

See ./examples .

Specification

The spec corresponds to the behavior of oras push IMAGE FILE1:application/octet-stream FILE2:application/octet-stream ... (ORAS v0.12).

  • 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).
  • A layer MUST have org.opencontainers.image.title annotation that corresponds to the file name.
  • A layer SHOULD have one of the following media types:
  • application/octet-stream
  • application/x-binary
You might also like...
Docker for Your ML/DL Models Based on OCI Artifacts
Docker for Your ML/DL Models Based on OCI Artifacts

English | 中文 ORMB is an open-source model registry to manage machine learning model. ORMB helps you manage your Machine Learning/Deep Learning models

Web gateway for OCI artifacts
Web gateway for OCI artifacts

Containerbay Web gateway for OCI artifacts Container images gateway browser and indexer Website static server - Reverse Container image browser Contai

oci-ccm custom build for both arm64 and amd64

OCI Cloud Controller Manager (CCM) oci-cloud-controller-manager is a Kubernetes Cloud Controller Manager implementation (or out-of-tree cloud-provider

My over-engineered homepage project to get an idea of the Kubernetes

My over-engineered homepage project to get an idea of the Kubernetes. It shows traffic data from all my GitHub repositories. I added RabbitMQ, Redis and MongoDB so I got to play around with multiple k8s resources

A helm v3 plugin to get values from a previous release

helm-val helm-val is a helm plugin to fetch values from a previous release. Getting started Installation To install the plugin: $ helm plugin install

easy way to distribute commands over ssh.

grapes grapes is lightweight tool designed to distribute commands over ssh with ease. Update (25/04/2019) Handshake validation is now in place in orde

HTTP load testing tool and library. It's over 9000!
HTTP load testing tool and library. It's over 9000!

Vegeta Vegeta is a versatile HTTP load testing tool built out of a need to drill HTTP services with a constant request rate. It can be used both as a

Run VS Code on any server over SSH.
Run VS Code on any server over SSH.

sshcode This project has been deprecated in favour of the code-server install script See the discussion in #185 sshcode is a CLI to automatically inst

Access your Kubernetes Deployment over the Internet
Access your Kubernetes Deployment over the Internet

Kubexpose: Access your Kubernetes Deployment over the Internet Kubexpose makes it easy to access a Kubernetes Deployment over a public URL. It's a Kub

Comments
  • Attempt to get the repo URI from the file URI

    Attempt to get the repo URI from the file URI

    While testing this transport I found that Target-Repo-URI was missing. from the apt messages causing fetches to fail.


    I'm not sure if this is right but it fixed the problem I was having (testing on Ubuntu Focal).

    opened by cpuguy83 0
  • Adding packages to an existing repo

    Adding packages to an existing repo

    Hello,

    Thanks a lot for your work on this. We are wanting to use this for package hosting but it looks like you have to push the entire repository each time you want to add a package. Am I missing something? The oras tool doesn't seem to offer a way to add layers to an image either.

    Any insight you could offer would be appreciated, thanks.

    Russ

    enhancement question 
    opened by russkel 4
Owner
Akihiro Suda
A maintainer of Moby(dockerd), BuildKit, containerd, and runc.
Akihiro Suda
An Oracle Cloud (OCI) Pulumi resource package, providing multi-language access to OCI

Oracle Cloud Infrastructure Resource Provider The Oracle Cloud Infrastructure (OCI) Resource Provider lets you manage OCI resources. Installing This p

Pulumi 13 Nov 10, 2022
ghcr images - Fetched from docker-library

ghcri ghcri is the repo for Github Container Registry Images. Just like docker-library for Docker Registry. Usage Replace all docker library from dock

null 17 Aug 15, 2022
🤖 Prune old images on GitHub (ghcr.io) and GitLab (registry.gitlab.com) container registry

✨ Prune container images in a CLI way ✨ Prune old images on GitHub (ghcr.io) and GitLab (registry.gitlab.com) Container Registry Getting Started | Des

> CI Monk 1 Jan 11, 2022
Dockpin - A tool for pinning Docker image and apt package versions

Dockpin Install dockpin with: go install github.com/Jille/[email protected] Dockpin

Jille Timmermans 18 Oct 21, 2022
Kubectl Locality Plugin - A plugin to get the locality of pods

Kubectl Locality Plugin - A plugin to get the locality of pods

John Howard 6 Nov 18, 2021
Vilicus is an open source tool that orchestrates security scans of container images(docker/oci) and centralizes all results into a database for further analysis and metrics.

Vilicus Table of Contents Overview How does it work? Architecture Development Run deployment manually Usage Example of analysis Overview Vilicus is an

Ederson Brilhante 79 Nov 17, 2022
OCI Image Encryption Package

imgcrypt image encryption library and command line tool Project imgcrypt is a non-core subproject of containerd. The imgcrypt library provides API exe

containerd 240 Nov 17, 2022
Simple, rootless, "FROM scratch" OCI image builder

zeroimage zeroimage some-program is like building the following Docker image: FROM scratch COPY some-program /some-program ENTRYPOINT ["/some-program"

Alex Hamlin 2 Jun 26, 2022
OCI drive, available from home

OCI Drive ... use your storage with Oracle Object Store Quick Start Make sure you have the Object Storage, bucket and you know the compartment id wher

Michal Conos 1 Nov 10, 2021
Executes an OCI image using firecracker.

oci-image-executor Executes an OCI image using Firecracker. Logs from the executed process (both stdout and stderr) are sent to stdout. Logs from the

CodeCrafters 1 Nov 14, 2022