{"id":24416697,"url":"https://github.com/lazauk/oras-ociartifact-cli","last_synced_at":"2026-04-18T00:02:12.813Z","repository":{"id":272202470,"uuid":"915082353","full_name":"LazaUK/ORAS-OCIArtifact-CLI","owner":"LazaUK","description":"Generating OCI Artifact in GitHub Container Registry (GHCR) and building a custom Web container image with ORAS and Docker CLI clients.","archived":false,"fork":false,"pushed_at":"2025-01-12T21:46:33.000Z","size":268,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T01:05:00.754Z","etag":null,"topics":["artifact","cli","container","docker","ghcr","github-actions","nginx","oci","open-container-initiative","oras","registry"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LazaUK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-10T23:32:54.000Z","updated_at":"2025-01-12T21:48:50.000Z","dependencies_parsed_at":"2025-01-12T22:30:59.256Z","dependency_job_id":"2d0ab37a-1a0c-41d4-972a-6bd67b90954f","html_url":"https://github.com/LazaUK/ORAS-OCIArtifact-CLI","commit_stats":null,"previous_names":["lazauk/oras-ociartifact-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LazaUK/ORAS-OCIArtifact-CLI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazaUK%2FORAS-OCIArtifact-CLI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazaUK%2FORAS-OCIArtifact-CLI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazaUK%2FORAS-OCIArtifact-CLI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazaUK%2FORAS-OCIArtifact-CLI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LazaUK","download_url":"https://codeload.github.com/LazaUK/ORAS-OCIArtifact-CLI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazaUK%2FORAS-OCIArtifact-CLI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artifact","cli","container","docker","ghcr","github-actions","nginx","oci","open-container-initiative","oras","registry"],"created_at":"2025-01-20T08:13:57.885Z","updated_at":"2026-04-18T00:02:12.758Z","avatar_url":"https://github.com/LazaUK.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ORAS and Docker CLI: Building Custom Images from OCI Artifacts\n\nThis guide walks you through generating an **OCI artifact** with the **ORAS CLI** client and then building a customised Docker image of an Nginx web service from that artifact. It includes a sample tarball and Dockerfile to facilitate end-to-end testing, from creating an OCI artifact to deploying a fully functional Web site.\n\n\u003e [!NOTE]\n\u003e - An [Open Container Initiative (OCI)](https://opencontainers.org/) artifact is a standardised, portable and secure way to package and distribute software.\n\u003e - [ORAS](https://oras.land/) enables distribution of artifacts across OCI-compliant registries, like GitHub Container Registry (GHCR).\n\n## Table of Contents\n* [Step 1: Create an OCI Artifact](#step-1-create-an-oci-artifact)\n* [Step 2: Build a Docker Image](#step-2-build-a-docker-image)\n* [Step 3: Deploy a Web site](#step-3-deploy-a-web-site)\n\n## Step 1: Create an OCI Artifact\n1. Install ORAS client as described [here](https://oras.land/docs/installation/).\n2. Create a **personal access token** (PAT) in GiHub's `Settings -\u003e Developer Settings -\u003e Personal Access Tokens -\u003e Tokens (classic)` section. You'll need to allow _read_, _write_ and _delete packages_ permissions in your PAT.\n3. Setup environment variables:\n``` PowerShell\nset GHCR_USER=\u003cGITHUB_USERNAME\u003e\nset GHCR_TOKEN=ghp_\u003cGITHUB_TOKEN\u003e\nset GHCR_REPO=\u003cGITHUB_REPO\u003e\n```\n4. Login to GHCR with ORAS client:\n``` PowerShell\noras login -u %GHCR_USER% -p %GHCR_TOKEN% ghcr.io\n```\n5. Push tarball and Dockerfile to GHCR as OCI artifact:\n``` PowerShell\noras.exe push ghcr.io/%GHCR_USER%/%GHCR_REPO%:v1 demopage.tar.gz:application/x-tar Dockerfile:text/plain\n```\n6. You can verify that the OCI artifact was created successfully by fetching its manifest file:\n``` PowerShell\noras manifest fetch --pretty ghcr.io/%GHCR_USER%/%GHCR_REPO%:v1\n```\n\u003e [!TIP]\n\u003e This guide assumes you're using Windows 11. Refer to the relevant documentation for specific instructions on setting environment variables on different platforms.\n\n## Step 2: Build a Docker Image\n1. Download the OCI artifact from GHCR:\n``` PowerShell\noras pull -o ./download ghcr.io/%GHCR_USER%/%GHCR_REPO%:v1\n```\n2. Login to GHCR with Docker CLI:\n``` PowerShell\ndocker login ghcr.io -u %GHCR_USER% -p %GHCR_TOKEN%\n```\n3. Build a Docker image from the downloaded OCI artifact:\n``` PowerShell\ndocker build -t ghcr.io/%GHCR_USER%/%GHCR_REPO%:latest ./download\n```\n4. Publish newly built Docker image on GHCR:\n``` PowerShell\ndocker push ghcr.io/%GHCR_USER%/%GHCR_REPO%:latest\n```\n\n## Step 3: Deploy a Web site\n1. Launch a container by pulling the latest version of the Docker image from GHCR:\n``` PowerShell\ndocker run -d --name DemoSite -p 8080:80 ghcr.io/%GHCR_USER%/%GHCR_REPO%:latest\n```\n2. Test Web site by opening [this URL](http://localhost:8080) locally.\n![Screenshot_of_Website](images/GHCR_tarball.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flazauk%2Foras-ociartifact-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flazauk%2Foras-ociartifact-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flazauk%2Foras-ociartifact-cli/lists"}