{"id":2806,"date":"2023-05-24T09:00:00","date_gmt":"2023-05-24T08:00:00","guid":{"rendered":"https:\/\/hypervlab.co.uk\/?p=2806"},"modified":"2023-05-23T20:02:30","modified_gmt":"2023-05-23T19:02:30","slug":"creating-a-github-container-registry","status":"publish","type":"post","link":"https:\/\/hypervlab.co.uk\/?p=2806","title":{"rendered":"Creating a GitHub Container Registry"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\"> 4<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>\n<p>In this blog post, we will cover the steps of creating a GitHub Container Registry, building an image and then uploading it to the Container Registry <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a GitHub PAT (Personal Access Token)<\/h2>\n\n\n\n<p>Firstly What is a GitHub PAT Token? Well, a GitHub Personal Access Token (PAT) is a type of token provided by GitHub that allows you to authenticate and authorize access to your GitHub account and its associated resources. PATs are primarily used for programmatic access to the GitHub API or when interacting with Git repositories hosted on GitHub. <\/p>\n\n\n\n<p>From the Github web page, Click on your Profile Picture and select &#8220;Settings&#8221;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-33.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-33-1024x293.png\" alt=\"\" class=\"wp-image-2808\" width=\"768\" height=\"220\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-33-1024x293.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-33-300x86.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-33-768x219.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-33-1536x439.png 1536w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-33-2048x585.png 2048w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-33-1470x420.png 1470w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-33-640x183.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-33-681x195.png 681w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure><\/div>\n\n\n<p>From the settings page, scroll to the bottom of the page and select on &#8220;Developer Settings&#8221; and then &#8220;Personal Access Tokens&#8221; and the &#8220;Token Classic&#8221;.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-32.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-32-1024x339.png\" alt=\"\" class=\"wp-image-2807\" width=\"768\" height=\"254\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-32-1024x339.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-32-300x99.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-32-768x254.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-32-1536x509.png 1536w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-32-1268x420.png 1268w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-32-640x212.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-32-681x226.png 681w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-32.png 1793w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure><\/div>\n\n\n<p>From the page, select &#8220;Generate New Token&#8221; to be able to interact with the package container registry we just need the following access rights:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-34.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-34-1024x395.png\" alt=\"\" class=\"wp-image-2809\" width=\"768\" height=\"296\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-34-1024x395.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-34-300x116.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-34-768x296.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-34-1536x593.png 1536w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-34-2048x790.png 2048w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-34-1089x420.png 1089w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-34-640x247.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-34-681x263.png 681w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure><\/div>\n\n\n<p>Once created save the PAT Token somewhere safe, Ideally into a Keyvault or Password Manager! <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-1-1024x447.jpg\" alt=\"\" class=\"wp-image-2811\" width=\"768\" height=\"335\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-1-1024x447.jpg 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-1-300x131.jpg 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-1-768x335.jpg 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-1-1536x670.jpg 1536w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-1-962x420.jpg 962w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-1-640x279.jpg 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-1-681x297.jpg 681w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-1.jpg 1906w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure><\/div>\n\n\n<p>Now we have a PatToken to authenticate into GitHub we can run the following code snippet<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$PatToken = \"&lt;insert-github-pat-token-here&gt;\"\n$PatToken | docker login ghcr.io\/&lt;username&gt;\/&lt;repository&gt; -u &lt;username&gt; --password-stdin<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-3.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-3-1024x570.jpg\" alt=\"\" class=\"wp-image-2812\" width=\"768\" height=\"428\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-3-1024x570.jpg 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-3-300x167.jpg 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-3-768x428.jpg 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-3-1536x855.jpg 1536w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-3-754x420.jpg 754w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-3-640x356.jpg 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-3-681x379.jpg 681w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image_censored-3.jpg 1613w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure><\/div>\n\n\n<p>Now we have authenticated to the GitHub Container Repository Service, We first need to build an image before we can push. <\/p>\n\n\n\n<p>You may recognise this Dockerfile \ud83d\ude0f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Define Operating System for Image\nFROM alpine:3.14\n\n# Execute Package Update and Upgrade\nRUN apk update\nRUN apk add --no-cache ca-certificates less ncurses-terminfo-base krb5-libs libgcc libintl libssl1.1 libstdc++ tzdata userspace-rcu zlib icu-libs curl\nRUN apk -X https:\/\/dl-cdn.alpinelinux.org\/alpine\/edge\/main add --no-cache lttng-ust\n\n# Download the powershell '.tar.gz' archive\nRUN curl -L https:\/\/github.com\/PowerShell\/PowerShell\/releases\/download\/v7.3.4\/powershell-7.3.4-linux-alpine-x64.tar.gz -o \/tmp\/powershell.tar.gz\n\n# Create the target folder where powershell will be placed\nRUN mkdir -p \/opt\/microsoft\/powershell\/7\n\n# Expand powershell to the target folder\nRUN tar zxf \/tmp\/powershell.tar.gz -C \/opt\/microsoft\/powershell\/7\n\n# Set execute permissions and create the symbolic link that points to pwsh\nRUN chmod +x \/opt\/microsoft\/powershell\/7\/pwsh\nRUN ln -s \/opt\/microsoft\/powershell\/7\/pwsh \/usr\/bin\/pwsh\n\n# Start PowerShell\nENTRYPOINT pwsh<\/code><\/pre>\n\n\n\n<p>To build an image which we can then push to the GitHub Container Registry we can use the following command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker build -t ghcr.io\/&lt;username&gt;\/&lt;repository&gt;:1.0 .<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-35.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-35-1024x569.png\" alt=\"\" class=\"wp-image-2814\" width=\"768\" height=\"427\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-35-1024x569.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-35-300x167.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-35-768x427.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-35-1536x854.png 1536w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-35-756x420.png 756w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-35-640x356.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-35-681x378.png 681w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-35.png 1614w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure><\/div>\n\n\n<p>Now we have the image created, we can push this to the GitHub Container Repository <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker push ghcr.io\/&lt;repositoty&gt;\/IMAGE_NAME:latest<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-36.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-36-1024x569.png\" alt=\"\" class=\"wp-image-2815\" width=\"768\" height=\"427\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-36-1024x569.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-36-300x167.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-36-768x427.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-36-1536x854.png 1536w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-36-756x420.png 756w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-36-640x356.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-36-681x378.png 681w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-36.png 1614w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure><\/div>\n\n\n<p>So we now have our GitHub COnatiner Package, However, if we visit the GitHub Repo we will notice that there are no packages assigned. <br>This initially confused me, however on investigation when you create a new Package in GitHub you need to manually assign this to the repository<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-37.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-37-1024x468.png\" alt=\"\" class=\"wp-image-2817\" width=\"768\" height=\"351\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-37-1024x468.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-37-300x137.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-37-768x351.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-37-1536x702.png 1536w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-37-919x420.png 919w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-37-640x292.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-37-681x311.png 681w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-37.png 2044w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure><\/div>\n\n\n<p>So to resolve this we need to go back to your GitHub Profile and select &#8220;Packages&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-39.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"348\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-39-1024x348.png\" alt=\"\" class=\"wp-image-2819\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-39-1024x348.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-39-300x102.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-39-768x261.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-39-1536x522.png 1536w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-39-2048x696.png 2048w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-39-1235x420.png 1235w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-39-640x218.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-39-681x232.png 681w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>Select the newly created package<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-40.png\"><img loading=\"lazy\" decoding=\"async\" width=\"969\" height=\"1024\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-40-969x1024.png\" alt=\"\" class=\"wp-image-2820\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-40-969x1024.png 969w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-40-284x300.png 284w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-40-768x812.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-40-1453x1536.png 1453w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-40-397x420.png 397w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-40-640x676.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-40-681x720.png 681w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-40.png 1667w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/><\/a><\/figure>\n\n\n\n<p>and then &#8220;Connect Repository&#8221; and choose the repository you want to connect to the container <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-41.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-41-1024x494.png\" alt=\"\" class=\"wp-image-2821\" width=\"768\" height=\"371\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-41-1024x494.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-41-300x145.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-41-768x370.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-41-871x420.png 871w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-41-640x308.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-41-681x328.png 681w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-41.png 1081w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure><\/div>\n\n\n<p>Once the package has been linked to the repository you should be greeted with this page.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-42.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-42-1024x528.png\" alt=\"\" class=\"wp-image-2822\" width=\"768\" height=\"396\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-42-1024x528.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-42-300x155.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-42-768x396.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-42-1536x793.png 1536w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-42-814x420.png 814w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-42-640x330.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-42-681x351.png 681w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-42.png 1800w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure><\/div>\n\n\n<p>and then finally, when we check the repository page again we can see that there is now a package assigned to the repository. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-43.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-43-1024x459.png\" alt=\"\" class=\"wp-image-2823\" width=\"768\" height=\"344\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-43-1024x459.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-43-300x135.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-43-768x345.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-43-1536x689.png 1536w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-43-936x420.png 936w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-43-640x287.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-43-681x306.png 681w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/image-43.png 2008w\" sizes=\"auto, (max-width: 768px) 100vw, 768px\" \/><\/a><\/figure><\/div>\n\n\n<p>and so there we have it, so to conclude and wrap up this post, We have covered creating a PAT Token, required authenticating to GitHub services, Once we have created the PAT Token, we have created a docker image with the name being the same as the repository and then finally pushed the new image to GitHub, to be used by other team members or used in a GitHub Action. <\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\"> 4<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>In this blog post, we will cover the steps of creating a GitHub Container Registry, building an image and then uploading it to the Container Registry Creating a GitHub PAT (Personal Access Token) Firstly What is a GitHub PAT Token? Well, a GitHub Personal Access Token (PAT) is a type of token provided by GitHub [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2825,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[337,341,338,336,120,121,334],"class_list":{"0":"post-2806","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-cloud","8":"tag-alpine","9":"tag-commandline","11":"tag-docker","12":"tag-github","13":"tag-linux","14":"tag-windowsterminal"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating a GitHub Container Registry - HypervLAB<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hypervlab.co.uk\/?p=2806\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating a GitHub Container Registry - HypervLAB\" \/>\n<meta property=\"og:description\" content=\"Reading Time:  4 minutesIn this blog post, we will cover the steps of creating a GitHub Container Registry, building an image and then uploading it to the Container Registry Creating a GitHub PAT (Personal Access Token) Firstly What is a GitHub PAT Token? Well, a GitHub Personal Access Token (PAT) is a type of token provided by GitHub [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hypervlab.co.uk\/?p=2806\" \/>\n<meta property=\"og:site_name\" content=\"HypervLAB\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-24T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-23T19:02:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/header_creating_a_github_container_registry.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Simon Lee\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/smoon_lee\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Simon Lee\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hypervlab.co.uk\/?p=2806\",\"url\":\"https:\/\/hypervlab.co.uk\/?p=2806\",\"name\":\"Creating a GitHub Container Registry - HypervLAB\",\"isPartOf\":{\"@id\":\"https:\/\/hypervlab.co.uk\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/hypervlab.co.uk\/?p=2806#primaryimage\"},\"image\":{\"@id\":\"https:\/\/hypervlab.co.uk\/?p=2806#primaryimage\"},\"thumbnailUrl\":\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/header_creating_a_github_container_registry.png\",\"datePublished\":\"2023-05-24T08:00:00+00:00\",\"dateModified\":\"2023-05-23T19:02:30+00:00\",\"author\":{\"@id\":\"https:\/\/hypervlab.co.uk\/#\/schema\/person\/7d184970612a9c6a5f1babb8b6b4d359\"},\"breadcrumb\":{\"@id\":\"https:\/\/hypervlab.co.uk\/?p=2806#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hypervlab.co.uk\/?p=2806\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/hypervlab.co.uk\/?p=2806#primaryimage\",\"url\":\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/header_creating_a_github_container_registry.png\",\"contentUrl\":\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/header_creating_a_github_container_registry.png\",\"width\":1200,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hypervlab.co.uk\/?p=2806#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/hypervlab.co.uk\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating a GitHub Container Registry\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hypervlab.co.uk\/#website\",\"url\":\"https:\/\/hypervlab.co.uk\/\",\"name\":\"HypervLAB\",\"description\":\"Blogging about all thing Microsoft\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/hypervlab.co.uk\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/hypervlab.co.uk\/#\/schema\/person\/7d184970612a9c6a5f1babb8b6b4d359\",\"name\":\"Simon Lee\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/hypervlab.co.uk\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9473a3cf9c75192508eccfd9d072efab80adf04a45083e561d0e3065f681c34c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9473a3cf9c75192508eccfd9d072efab80adf04a45083e561d0e3065f681c34c?s=96&d=mm&r=g\",\"caption\":\"Simon Lee\"},\"description\":\"Hi, I'm Simon an IT Enthusiast, PowerShell Geek, Gamer, and Sound Engineer. I've been working with in the IT Industry for around 6 years and have worked across private and public sector companies. The original idea behind \\\"hypervlab\\\" was that I required an 'RnD' environment which would allow me to be able to replicate any kind of enterprise on-premise environment which I could use for learning and testing without learning in a production environment. So in 2019, I decided to branch out and use the domain for a public facing blog to be able to contribute to the IT Community about all things Microsoft.\",\"sameAs\":[\"https:\/\/hypervlab.co.uk\",\"https:\/\/www.linkedin.com\/in\/simon-john-lee\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/smoon_lee\"],\"url\":\"https:\/\/hypervlab.co.uk\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating a GitHub Container Registry - HypervLAB","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hypervlab.co.uk\/?p=2806","og_locale":"en_GB","og_type":"article","og_title":"Creating a GitHub Container Registry - HypervLAB","og_description":"Reading Time:  4 minutesIn this blog post, we will cover the steps of creating a GitHub Container Registry, building an image and then uploading it to the Container Registry Creating a GitHub PAT (Personal Access Token) Firstly What is a GitHub PAT Token? Well, a GitHub Personal Access Token (PAT) is a type of token provided by GitHub [&hellip;]","og_url":"https:\/\/hypervlab.co.uk\/?p=2806","og_site_name":"HypervLAB","article_published_time":"2023-05-24T08:00:00+00:00","article_modified_time":"2023-05-23T19:02:30+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/header_creating_a_github_container_registry.png","type":"image\/png"}],"author":"Simon Lee","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/smoon_lee","twitter_misc":{"Written by":"Simon Lee","Estimated reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/hypervlab.co.uk\/?p=2806","url":"https:\/\/hypervlab.co.uk\/?p=2806","name":"Creating a GitHub Container Registry - HypervLAB","isPartOf":{"@id":"https:\/\/hypervlab.co.uk\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hypervlab.co.uk\/?p=2806#primaryimage"},"image":{"@id":"https:\/\/hypervlab.co.uk\/?p=2806#primaryimage"},"thumbnailUrl":"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/header_creating_a_github_container_registry.png","datePublished":"2023-05-24T08:00:00+00:00","dateModified":"2023-05-23T19:02:30+00:00","author":{"@id":"https:\/\/hypervlab.co.uk\/#\/schema\/person\/7d184970612a9c6a5f1babb8b6b4d359"},"breadcrumb":{"@id":"https:\/\/hypervlab.co.uk\/?p=2806#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hypervlab.co.uk\/?p=2806"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/hypervlab.co.uk\/?p=2806#primaryimage","url":"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/header_creating_a_github_container_registry.png","contentUrl":"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2023\/05\/header_creating_a_github_container_registry.png","width":1200,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/hypervlab.co.uk\/?p=2806#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hypervlab.co.uk\/"},{"@type":"ListItem","position":2,"name":"Creating a GitHub Container Registry"}]},{"@type":"WebSite","@id":"https:\/\/hypervlab.co.uk\/#website","url":"https:\/\/hypervlab.co.uk\/","name":"HypervLAB","description":"Blogging about all thing Microsoft","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hypervlab.co.uk\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/hypervlab.co.uk\/#\/schema\/person\/7d184970612a9c6a5f1babb8b6b4d359","name":"Simon Lee","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/hypervlab.co.uk\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9473a3cf9c75192508eccfd9d072efab80adf04a45083e561d0e3065f681c34c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9473a3cf9c75192508eccfd9d072efab80adf04a45083e561d0e3065f681c34c?s=96&d=mm&r=g","caption":"Simon Lee"},"description":"Hi, I'm Simon an IT Enthusiast, PowerShell Geek, Gamer, and Sound Engineer. I've been working with in the IT Industry for around 6 years and have worked across private and public sector companies. The original idea behind \"hypervlab\" was that I required an 'RnD' environment which would allow me to be able to replicate any kind of enterprise on-premise environment which I could use for learning and testing without learning in a production environment. So in 2019, I decided to branch out and use the domain for a public facing blog to be able to contribute to the IT Community about all things Microsoft.","sameAs":["https:\/\/hypervlab.co.uk","https:\/\/www.linkedin.com\/in\/simon-john-lee\/","https:\/\/x.com\/https:\/\/twitter.com\/smoon_lee"],"url":"https:\/\/hypervlab.co.uk\/?author=2"}]}},"_links":{"self":[{"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2806","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2806"}],"version-history":[{"count":6,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2806\/revisions"}],"predecessor-version":[{"id":2827,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2806\/revisions\/2827"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/media\/2825"}],"wp:attachment":[{"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}