{"id":412,"date":"2023-11-18T10:56:00","date_gmt":"2023-11-18T10:56:00","guid":{"rendered":"https:\/\/devopsopen.com\/?p=412"},"modified":"2023-11-19T00:21:27","modified_gmt":"2023-11-19T00:21:27","slug":"connection-to-dockerhub-repository","status":"publish","type":"post","link":"https:\/\/devopsopen.com\/index.php\/2023\/11\/18\/connection-to-dockerhub-repository\/","title":{"rendered":"Connection to DockerHub repository"},"content":{"rendered":"<h2>Create secret<\/h2>\n<pre><code>kubectl create secret docker-registry regcred --docker-server=https:\/\/index.docker.io\/v1\/ --docker-username=&lt;your-name&gt; --docker-password=&lt;your-pword&gt; --docker-email=&lt;your-email&gt;<\/code><\/pre>\n<p>transfor to yaml format<\/p>\n<pre><code>kubectl get secret regcred --output=yaml<\/code><\/pre>\n<p>Create secret file Yml with output information<\/p>\n<pre><code>apiVersion: v1\nkind: Secret\nmetadata:\n  name: registryfront-credentials\n  namespace: ael-0001-payroll-uat\ntype: kubernetes.io\/dockerconfigjson\ndata:\n  .dockerconfigjson: eyJhdXRocyI6eyJodHRwczovL2luZGV4LmRgY2tlci5pby92MS8iOnsidXNlcm5hbWUiOiJ2aXhhdml4YSIsInBhc3N3b3JkIjoiZGNrrl9wYXRfck94R3Q3cEVqd3U3N1pzUFNjQXBSMpluOGxVIiwiZW1haWwiOiJ2aXhhd2ViM0BnbWFpbC5jb20iLCJhdXRoIjoiZG1sNFlYWnBlR0U2WkdOcmNsOXdZWFJmY2s5NFIzUTNjRVZxZDNVM04xcHpVRk5qUVhCU01qbHVPR3hWIn19fQ==<\/code><\/pre>\n<p>Put this file into K8S manifests<\/p>\n<h2>Create access token into Dockerhub<\/h2>\n<p>go to the profile and create access token, then use it into gitlabci file <\/p>\n<pre><code>    - docker login -u &quot;vixavixa&quot; -p &quot;dckr_pat_rOxGt7pEjwu658sPScApR2sqsq8lU&quot; docker.io\n  script:\n    - docker build -t vixavixa\/images:nginx1 -f Dockerfile .\n    - docker push vixavixa\/images:nginx1\n  after_script:\n    - docker logout\n<\/code><\/pre>\n<p>vixavixa\/images is the repository into dockerhub and nginx1 is the tag<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devopsopen.com\/wp-content\/uploads\/2023\/11\/dockerimg1.png\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create secret kubectl create secret docker-registry regcred &#8211;docker-server=https:\/\/index.docker.io\/v1\/ &#8211;docker-username=&lt;your-name&gt; &#8211;docker-password=&lt;your-pword&gt; &#8211;docker-email=&lt;your-email&gt; transfor to yaml format kubectl get secret regcred &#8211;output=yaml Create secret file Yml with output information apiVersion: v1 kind: Secret metadata: name: registryfront-credentials namespace: ael-0001-payroll-uat type: kubernetes.io\/dockerconfigjson data: .dockerconfigjson: eyJhdXRocyI6eyJodHRwczovL2luZGV4LmRgY2tlci5pby92MS8iOnsidXNlcm5hbWUiOiJ2aXhhdml4YSIsInBhc3N3b3JkIjoiZGNrrl9wYXRfck94R3Q3cEVqd3U3N1pzUFNjQXBSMpluOGxVIiwiZW1haWwiOiJ2aXhhd2ViM0BnbWFpbC5jb20iLCJhdXRoIjoiZG1sNFlYWnBlR0U2WkdOcmNsOXdZWFJmY2s5NFIzUTNjRVZxZDNVM04xcHpVRk5qUVhCU01qbHVPR3hWIn19fQ== Put this file into K8S manifests Create access token into Dockerhub go to the profile and create access token, then use it into gitlabci file &#8211; docker login -u &quot;vixavixa&quot; -p &quot;dckr_pat_rOxGt7pEjwu658sPScApR2sqsq8lU&quot; docker.io script: &#8211; docker build -t vixavixa\/images:nginx1 -f Dockerfile . &#8211; docker push vixavixa\/images:nginx1 after_script: &#8211; docker logout vixavixa\/images is the repository into dockerhub and nginx1 is\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":""},"categories":[10],"tags":[],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":5}},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"admin","author_link":"https:\/\/devopsopen.com\/index.php\/author\/admin_bak\/"},"uagb_comment_info":686,"uagb_excerpt":"Create secret kubectl create secret docker-registry regcred --docker-server=https:\/\/index.docker.io\/v1\/ --docker-username=&lt;your-name&gt; --docker-password=&lt;your-pword&gt; --docker-email=&lt;your-email&gt; transfor to yaml format kubectl get secret regcred --output=yaml Create secret file Yml with output information apiVersion: v1 kind: Secret metadata: name: registryfront-credentials namespace: ael-0001-payroll-uat type: kubernetes.io\/dockerconfigjson data: .dockerconfigjson: eyJhdXRocyI6eyJodHRwczovL2luZGV4LmRgY2tlci5pby92MS8iOnsidXNlcm5hbWUiOiJ2aXhhdml4YSIsInBhc3N3b3JkIjoiZGNrrl9wYXRfck94R3Q3cEVqd3U3N1pzUFNjQXBSMpluOGxVIiwiZW1haWwiOiJ2aXhhd2ViM0BnbWFpbC5jb20iLCJhdXRoIjoiZG1sNFlYWnBlR0U2WkdOcmNsOXdZWFJmY2s5NFIzUTNjRVZxZDNVM04xcHpVRk5qUVhCU01qbHVPR3hWIn19fQ== Put this file into K8S manifests Create access token into Dockerhub go to the&hellip;","_links":{"self":[{"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/posts\/412"}],"collection":[{"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/comments?post=412"}],"version-history":[{"count":2,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/posts\/412\/revisions"}],"predecessor-version":[{"id":415,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/posts\/412\/revisions\/415"}],"wp:attachment":[{"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/media?parent=412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/categories?post=412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devopsopen.com\/index.php\/wp-json\/wp\/v2\/tags?post=412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}