{"id":3065,"date":"2023-01-22T04:05:36","date_gmt":"2023-01-22T04:05:36","guid":{"rendered":"http:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/?p=3065"},"modified":"2023-01-22T04:06:30","modified_gmt":"2023-01-22T04:06:30","slug":"exporting-a-docker-image-to-docker-hub","status":"publish","type":"post","link":"https:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/2023\/01\/22\/exporting-a-docker-image-to-docker-hub\/","title":{"rendered":"Exporting a Docker Image to Docker Hub"},"content":{"rendered":"<ol>\n<li>Enter the root user account\n<ol>\n<li>sudo -i<\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">View current running docker containers to find the one you want to upload<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Docker ps -a<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You can make sure its the correct machine by interfacing with it and checking the files<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Docker exec -it &lt;<\/span><span style=\"font-weight: 400\">CONTAINER ID&gt; (<span style=\"color: #ff0000\">EX: 50b2e9d0dff6<\/span>)<\/span><span style=\"font-weight: 400\"> bash<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Docker exec -it 50b2e9d0dff6 bash<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Here you can use it as you would a regular CMD Linux PC<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">To exit the container, do the command: &#8220;<\/span><span style=\"font-weight: 400\">exit&#8221;<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Commit Container to an Image (This turns the container into a docker image for reuse)<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Docker commit &lt;<\/span><span style=\"font-weight: 400\">CONTAINER ID&gt; &lt;<\/span><span style=\"font-weight: 400\">DOCKER HUB USERNAME&gt;<\/span><span style=\"font-weight: 400\">\/&lt;Your_<\/span><span style=\"font-weight: 400\">Image_Name&gt;<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">EX: docker commit 50b2e9d0dff6 mpeck\/ubuntu-modified<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Log into your Docker Hub account on the docker-machine<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">docker login<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">You will then enter your docker hub username and password<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Push the docker image to Docker Hub<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">docker push &lt;username&gt;\/&lt;Image_Name&gt;<\/span>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">EX: docker push mpeck\/ubuntu-modified<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Check Docker Hub<\/span>\n<ol>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/hub.docker.com\/\"><span style=\"font-weight: 400\">https:\/\/hub.docker.com\/<\/span><\/a><\/li>\n<li>Log into the account you used to push the container<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Check the \u201crepository\u201d tab for your container.<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Enter the root user account sudo -i View current running docker containers to find the one you want to upload Docker ps -a You can make sure its the correct machine by interfacing with it and checking the files Docker exec -it &lt;CONTAINER ID&gt; (EX: 50b2e9d0dff6) bash Docker exec -it 50b2e9d0dff6 bash Here you can &hellip; <a href=\"https:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/2023\/01\/22\/exporting-a-docker-image-to-docker-hub\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Exporting a Docker Image to Docker Hub<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1303,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-3065","post","type-post","status-publish","format-standard","hentry","category-it-support"],"_links":{"self":[{"href":"https:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/wp-json\/wp\/v2\/posts\/3065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/wp-json\/wp\/v2\/users\/1303"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/wp-json\/wp\/v2\/comments?post=3065"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/wp-json\/wp\/v2\/posts\/3065\/revisions"}],"predecessor-version":[{"id":3066,"href":"https:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/wp-json\/wp\/v2\/posts\/3065\/revisions\/3066"}],"wp:attachment":[{"href":"https:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/wp-json\/wp\/v2\/media?parent=3065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/wp-json\/wp\/v2\/categories?post=3065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.nationaltrail.k12.oh.us\/ittech\/wp-json\/wp\/v2\/tags?post=3065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}