Skip to main content

Append a tarball to an image in a container registry

Project description

Append layer to container registry image

This utility script appends a tarball to an existing container image available in a container registry (without having to pull existing image data).

It supports any registry that implements the OCI Distribution Spec.

Installation

Use the script as-is or install using pip:

$ pip install appendlayer

This registers the entry-point "appendlayer" which typically lets you call it directly as an executable command.

Authentication

The script reads an OAuth2 refresh token from the REFRESH_TOKEN environment variable.

For example, for Azure Container Registry:

$ export REFRESH_TOKEN=$(az acr login -t --name <registry-name>.azurecr.io 2>/dev/null | \
      jq -r .accessToken)

(The snippet above requires jq to print out the access token.)

Usage

Pipe in the layer contents using a tarball and provide the repository (or image) name and the old and new tags:

$ echo "Hello world" > test.txt
$ tar cvf - test.txt | appendlayer <host> <repository> <old-tag> <new-tag>

For Azure Container Registry (ACR) for example, the host is typically <registry-name>.azurecr.io.

Changes

1.0 (2022-01-29)

  • Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

appendlayer-1.0.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file appendlayer-1.0.tar.gz.

File metadata

  • Download URL: appendlayer-1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for appendlayer-1.0.tar.gz
Algorithm Hash digest
SHA256 998ee8e36c74f0457022acdeafd69b9678c37b12daa96d1bb4b9dae1da87dbc7
MD5 d1c83238224c03ff1d76eedcd332d30e
BLAKE2b-256 84fcabecdda5c9222e3c6a5e3a00c6011b6203809f796e6f6ace40c66d8515c6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page