{"id":2104,"date":"2015-10-26T15:54:21","date_gmt":"2015-10-26T15:54:21","guid":{"rendered":"https:\/\/unihost.com\/help\/?p=2104"},"modified":"2023-01-19T14:00:05","modified_gmt":"2023-01-19T11:00:05","slug":"how-to-install-docker","status":"publish","type":"post","link":"https:\/\/unihost.com\/help\/how-to-install-docker\/","title":{"rendered":"How to install Docker"},"content":{"rendered":"<h2><span style=\"font-family: Ubuntu,sans-serif;\">How to install Docker on CentOS\/RedHat\/Fedora<\/span><\/h2>\n<p><span style=\"font-family: Ubuntu, sans-serif;\"> Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux. Docker uses resource isolation features of the Linux kernel such as cgroups and kernel namespaces to allow independent &#8220;containers&#8221; to run within a single Linux instance, avoiding the overhead of starting and maintaining virtual machines.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Those container which is created and tested on the laptop can be easily migrated to production servers in the cloud or to the other areas.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Docker is used for:<\/span><\/p>\n<ul>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"> automatic packaging and application deployment;<\/span><\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\">creation of lightweight PaaS environment;<\/span><\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\">automated testing and continuous integration\/deployment;<\/span><\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\">deploying and scaling web apps, databases and backend services.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">How to install Docker on CentOS\/RedHat\/Fedora.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">If you need to check your OS version, use this: <\/span><\/p>\n<div id=\"crayon-55f87ae6b237c366851102\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b237c366851102-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-v\">cat<\/span> <span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">etc<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">issue<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"text-decoration: underline;\"><span style=\"font-family: Ubuntu,sans-serif;\"><strong>How to install Docker on CentOS\/RedHat.<\/strong><\/span><\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Docker runs on CentOS 7 by default but on CentOS 6 it is in EPEL repository. Pay attention that instllation process differs a little for different versions. You can always use the last version and download a binary file that works on 3.8 core and more.<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\">This tutorial is for CentOS 6 and later versions. Admittedly it will be relevant to other binary distributions EL6(for example, Scientific Linux), but this assumption was not tested.<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\">Please, pay attention, Docker needs 64-bit architecture to work correctly.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0422\u043e run Docker you need CentOS 6 or later versions with 2.6.32-431 core version or more.<\/span><\/p>\n<p><span style=\"text-decoration: underline;\"><span style=\"font-family: Ubuntu,sans-serif;\"><em>How to install Docker on CentOS 6<\/em><\/span><\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\">Please, pay attention that for SentOS Docker is a part of Enterprise Linux (EPEL) additional repository, so you have to <span style=\"color: #000000;\">set it up.<\/span><\/span><\/p>\n<p><strong><strong>If you use <\/strong>RHEL\/CentOS 6 with 32-<strong>bit architecture<br \/>\n<\/strong><\/strong><\/p>\n<div id=\"crayon-55f8b23541529665616507\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<div class=\"crayon-line\">\n<div class=\"crayon-pre\">\n<div class=\"crayon-pre\">\n<div class=\"crayon-line\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div class=\"crayon-pre\">\n<div class=\"crayon-line\"><span class=\"crayon-p\"># <\/span>rpm -ivh http:\/\/download.fedoraproject.org\/pub\/epel\/6\/i386\/epel-release-6-8.noarch.rpm<\/div>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong><strong>If you use <\/strong>RHEL\/CentOS 6 with 64-<strong>bit architecture<br \/>\n<\/strong><\/strong><\/p>\n<div id=\"crayon-55f8b2354152e487469870\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f8b2354152e487469870-1\" class=\"crayon-line\"><span class=\"crayon-p\"># rpm -ivh http:\/\/download.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm<\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><em>Docker-io is necessary to install Docker via Epel.<\/em><\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"> If you installed a docker-io earlier and it is incompatible with Doker, please, remove this docker-io.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Then you have to install Docker-IO with its help you will be able to install Docker:<\/span><\/p>\n<div id=\"crayon-55f87ae6b2392813453323\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2392813453323-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">yum <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-v\">docker<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">io<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2><span style=\"font-family: Ubuntu,sans-serif;\">How to use Docker<\/span><\/h2>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">When Docker is installed start Docker-daemon:<\/span><\/p>\n<div id=\"crayon-55f87ae6b2397401444934\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2397401444934-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">service <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">start<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"> To start Docker simultaneously with the boot of your OS:<\/span><\/p>\n<div id=\"crayon-55f87ae6b239b462530768\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b239b462530768-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">chkconfig <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">on<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">You need to test Docker. Get the last version of CentOS image:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23a0809321245\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23a0809321245-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-e\">pull <\/span><span class=\"crayon-v\">centos<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">You may also get other Linux distributives (Debian, Ubuntu etc.) using the same algorithm. For example, download one more image:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23a4170557897\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23a4170557897-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-i\">pull<\/span> <span class=\"crayon-v\">debian<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">These commands will help you to download the OS image. If necessary, you may dwnload container with software (for example, nginx, apache, mysql etc.):<\/span><\/p>\n<div id=\"crayon-55f87ae6b23a8165695991\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23a8165695991-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">package<\/span><span class=\"crayon-sy\">_<\/span>name<\/span><\/div>\n<div id=\"crayon-55f87ae6b23a8165695991-2\" class=\"crayon-line crayon-striped-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-e\">pull <\/span><span class=\"crayon-v\">nginx<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"> package_name \u2013 programme name (container with a programm).<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">To look through all images use this command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23ad984798917\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23ad984798917-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">images<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4336\" src=\"https:\/\/unihost.com\/help\/minio.php?2016\/07\/Gwrx58n.png\" alt=\"How to install Docker\" width=\"664\" height=\"66\" \/ title=\"How to install Docker - Image 1\"><\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Start Bash to test the image:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23b1653459557\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23b1653459557-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">run<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">i<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">t<\/span> <span class=\"crayon-v\">centos<\/span> <span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bin<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bash<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Container name is generated automatically, but you may set it manually.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Let&#8217;s set the container in a vim text editor:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23b6400441920\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23b6400441920-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">yum <\/span><span class=\"crayon-i\">update<\/span><\/span><\/div>\n<div id=\"crayon-55f87ae6b23b6400441920-2\" class=\"crayon-line crayon-striped-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">yum <\/span><span class=\"crayon-e\">install <\/span><span class=\"crayon-v\">vim<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">If everything works correctly, you get a simple output from bash. Type \u201cexit\u201d to exit. When exiting the container it stops working.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">You can display all running containers with the following command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23ba320825473\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23ba320825473-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">ps<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">a<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4344\" src=\"https:\/\/unihost.com\/help\/minio.php?2016\/07\/FO5l4kZ.png\" alt=\"How to install Docker\" width=\"984\" height=\"117\" \/ title=\"How to install Docker - Image 2\"><\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">When you use the command \u201cdocker ps -a\u201d you may see the name of the container. This command shows all created containers.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">To list only running containers, run the following command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23bf225329205\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23bf225329205-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">ps<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>As noted above, when creating the container name is generated automatically but if you want to change it, do the following:<\/p>\n<div id=\"crayon-55f87ae6b23c4248396584\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23c4248396584-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">run<\/span> <span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-e\">name <\/span><span class=\"crayon-v\">my<\/span><span class=\"crayon-sy\">_<\/span>container <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">t<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">i<\/span> <span class=\"crayon-v\">centos<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">my_container \u2013 new container name<\/span><\/p>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">If the command described above fails, then try another one:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23c8459776560\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23c8459776560-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">run<\/span> <span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-i\">name<\/span> <span class=\"crayon-v\">my<\/span><span class=\"crayon-sy\">_<\/span>container <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">t<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">i<\/span> <span class=\"crayon-v\">centos<\/span> <span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bin<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bash<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">ATTENTION! The command \u201crun\u201d is the command to create and start new container.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">You may use an ID or a created name to work with the container. Let&#8217;s start the container:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23cc141475676\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23cc141475676-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-i\">start<\/span> <span class=\"crayon-v\">my_container<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">ATTENTION! The command \u201cstart\u201d is a command to start the container created before.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">When container is running, we have to connect it using the command attach:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23d1866887981\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23d1866887981-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-i\">attach<\/span> <span class=\"crayon-v\">my_container<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">If nothing happens, press \u201cEnter\u201d to enter the bash in the container. <\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">All changes you may commit to use them later:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23d5602701699\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23d5602701699-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">commit<\/span> <span class=\"crayon-o\">&lt;container_<\/span><span class=\"crayon-v\">id<\/span><span class=\"crayon-o\">&gt;<\/span> <span class=\"crayon-o\">&lt;<\/span>image<span class=\"crayon-i\">_<\/span>name<span class=\"crayon-o\">&gt;<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><strong><span style=\"text-decoration: underline;\">Image transfer to another web hosting<\/span><br \/>\n<\/strong>For example, if you had finished set up (already installed applications to Docker and have committed it all in the image), you can safely save the image to a file for transfer to another web hosting:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23d9677071113\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23d9677071113-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-i\">save<\/span> \u0438\u043c\u044f<span class=\"crayon-i\">_<\/span>\u043e\u0431\u0440\u0430\u0437\u0430 <span class=\"crayon-o\">&gt;<\/span> <span class=\"crayon-o\">~<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">my_container_for_nransfer<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">tar<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Transfer the file archive (image) to anotherweb hosting (for example, using scp) and then import it in Docker using following command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23de265275922\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23de265275922-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">load<\/span> <span class=\"crayon-o\">&lt;<\/span> <span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">tmp<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">my_container_for_nransfer<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">tar<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">That&#8217;s all, you can easily transfer your application between hosts, private clouds and servers. No restriction on iron. This is one of the main advantages of Docker and it&#8217;s worth attention!<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">ATTENTION! If you saved data on the mounted file system, don&#8217;t forget to move it.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><strong><span style=\"text-decoration: underline;\">Container-daemon creation<\/span><br \/>\n<\/strong>It is possible to create long-lived containers that are suitable for running applications and services. These containers do not have interactive session:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23e3885812942\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23e3885812942-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">run<\/span> <span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-e\">name <\/span><span class=\"crayon-v\">container<\/span><span class=\"crayon-sy\">_<\/span>name <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">d<\/span> <span class=\"crayon-i\">centos<\/span> <span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bin<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bash<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">c<\/span> <span class=\"crayon-s\">&#8220;while true; do echo hello world; sleep 1; done&#8221;<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"> container_name \u2013 container name.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">You may supervise the work of your container using the following command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23e7580714005\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23e7580714005-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">logs<\/span> <span class=\"crayon-o\">&lt;<\/span><span class=\"crayon-v\">container_name<\/span><span class=\"crayon-o\">&gt;<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">If you want to stop the container, use the following command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23eb334072573\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\"><\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23eb334072573-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">stop<\/span> <span class=\"crayon-o\">&lt;<\/span><span class=\"crayon-v\">container_name<\/span><span class=\"crayon-o\">&gt;<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">If you want to run the container, use the following::<\/span><\/p>\n<div id=\"crayon-55f87ae6b23ef767495163\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23ef767495163-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">start<\/span> <span class=\"crayon-o\">&lt;<\/span><span class=\"crayon-v\">container_name<\/span><span class=\"crayon-o\">&gt;<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">At the start the while loop will continue its work from the last stop.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Tocheck the details about the work of your container, use the following command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23f3368719533\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23f3368719533-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">inspect<\/span> <span class=\"crayon-o\">&lt;<\/span><span class=\"crayon-v\">container_name<\/span><span class=\"crayon-o\">&gt;<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">To remove Your container, use this command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23f7651277647\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23f7651277647-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">rm<\/span> <span class=\"crayon-o\">&lt;<\/span><span class=\"crayon-v\">container_name<\/span><span class=\"crayon-o\">&gt;<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">In order to register the name of your web hosting company in your container, use this command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b23fb122140354\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b23fb122140354-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">run<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">t<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">i<\/span> <span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-v\">hostname<\/span><span class=\"crayon-o\">=<\/span><span class=\"crayon-v\">ubuntu<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-e\">box <\/span><span class=\"crayon-i\">debian<\/span> <span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bin<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bash<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">You can also add a parameter that will allow you to set up the correct name of your container.<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\"><strong><span style=\"text-decoration: underline;\">To put in or to get data out of the container<\/span><br \/>\n<\/strong>If you want to copy data to the container or to extract data, use this command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b2400243616142\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2400243616142-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">cp<\/span> <span class=\"crayon-o\">&lt;<\/span>path<span class=\"crayon-i\">_<\/span>to<span class=\"crayon-i\">_<\/span>the<span class=\"crayon-i\">_<\/span>data<span class=\"crayon-i\">_<\/span>on_web_hosting<span class=\"crayon-o\">&gt;<\/span> <span class=\"crayon-o\">&lt;<\/span><span class=\"crayon-v\">container_name<\/span><span class=\"crayon-o\">&gt;<\/span><span class=\"crayon-o\">:<\/span><span class=\"crayon-o\">&lt;<\/span>\u043f\u0443\u0442\u044c<span class=\"crayon-o\">&gt;<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">For example, you need to download some from the container file and put it in your home directory, use this command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b2404844361105\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2404844361105-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-e\">cp <\/span><span class=\"crayon-v\">bcfa1008952e<\/span><span class=\"crayon-o\">:<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">etc<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">nginx<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">nginx<\/span><span class=\"crayon-sy\">.<\/span><span class=\"crayon-v\">conf<\/span> <span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">home<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">captain<\/span><span class=\"crayon-o\">\/<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"> bcfa1008952e &#8211; container ID<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">To mount a host folder into the container (when you are creating it) do this:<\/span><\/p>\n<div id=\"crayon-55f87ae6b2408322648148\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2408322648148-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">run<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">v<\/span> <span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">tmp<\/span><span class=\"crayon-o\">:<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">root<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">t<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">i<\/span> <span class=\"crayon-o\">&lt;<\/span>Image<span class=\"crayon-i\">_<\/span>name<span class=\"crayon-o\">&gt;<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\/tmp \u2013 path to the folder on your web hosting.<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\"> \/root \u2013 path to the folder on your server.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">So you can easily work with data from the container and with the data on the web hosting. You do not need to copy data in both directions.<\/span><\/p>\n<p><span style=\"text-decoration: underline;\"><span style=\"font-family: Ubuntu,sans-serif;\"><strong>Image removal<\/strong><\/span><\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">In order to remove the image, use this command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b240d031169883\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b240d031169883-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-e\">rmi <\/span><span class=\"crayon-v\">the_image_name<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"text-decoration: underline;\"><span style=\"font-family: Ubuntu,sans-serif;\"><strong>All images removal<\/strong><\/span><\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">To remove all the images use this command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b2411941157477\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2411941157477-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-i\">rmi<\/span> <span class=\"crayon-sy\">$<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">images<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">q<\/span><span class=\"crayon-sy\">)<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><strong><span style=\"text-decoration: underline;\">Finish all the processes in the container and delete them:<\/span><\/strong><\/span><\/p>\n<div id=\"crayon-55f87ae6b2415066687357\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2415066687357-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-i\">rm<\/span> <span class=\"crayon-sy\">$<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-i\">kill<\/span> <span class=\"crayon-sy\">$<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">ps<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">q<\/span><span class=\"crayon-sy\">)<\/span><span class=\"crayon-sy\">)<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">or<\/span><\/p>\n<div id=\"crayon-55f87ae6b2419539592249\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-nums \" data-settings=\"show\"><\/td>\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2419539592249-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">rm<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">f<\/span> <span class=\"crayon-sy\">$<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">ps<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">a<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">q<\/span><span class=\"crayon-sy\">)<\/span><\/span><\/div>\n<div id=\"crayon-55f87ae6b2419539592249-2\" class=\"crayon-line crayon-striped-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">rm<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">f<\/span> <span class=\"crayon-sy\">$<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">ps<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">a<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">q<\/span> <span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-i\">filter<\/span> <span class=\"crayon-s\">&#8216;exited=0&#8217;<\/span><span class=\"crayon-sy\">)<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">or<\/span><\/p>\n<div id=\"crayon-55f87ae6b241d539825295\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b241d539825295-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">ps<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">a<\/span> <span class=\"crayon-o\">|<\/span> <span class=\"crayon-e\">grep <\/span><span class=\"crayon-v\">Exit<\/span> <span class=\"crayon-o\">|<\/span> <span class=\"crayon-i\">awk<\/span> <span class=\"crayon-s\">&#8216;{print $1}&#8217;<\/span> <span class=\"crayon-o\">|<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">xargs <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">rm<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Note: Replace \u201ckill\u201d to \u201cstop\u201d for the gradual shutdown of all the containers<\/span><\/p>\n<p><span style=\"text-decoration: underline;\"><span style=\"font-family: Ubuntu,sans-serif;\"><strong>To remove all the images, starting with those that you created, use this command:<\/strong><\/span><\/span><\/p>\n<div id=\"crayon-55f87ae6b2421743642906\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2421743642906-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-i\">rmi<\/span> <span class=\"crayon-sy\">$<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">images<\/span> <span class=\"crayon-o\">|<\/span> <span class=\"crayon-v\">grep<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">v<\/span> <span class=\"crayon-s\">&#8216;centos\\|my-image&#8217;<\/span> <span class=\"crayon-o\">|<\/span> <span class=\"crayon-e\">awk<\/span> <span class=\"crayon-sy\">{<\/span><span class=\"crayon-s\">&#8216;print $3&#8217;<\/span><span class=\"crayon-sy\">}<\/span><span class=\"crayon-sy\">)<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">You can use &#8220;grep&#8221; command to remove all the images except my-image and centos, for example.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><strong><span style=\"text-decoration: underline;\">Remove all the \u201c&lt;none&gt;\u201d images:<\/span><\/strong><\/span><\/p>\n<div id=\"crayon-55f87ae6b2426104186953\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2426104186953-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-st\">for<\/span> <span class=\"crayon-i\">i<\/span> <span class=\"crayon-st\">in<\/span> <span class=\"crayon-sy\">`<\/span><span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">images<\/span><span class=\"crayon-o\">|<\/span><span class=\"crayon-i\">grep<\/span> <span class=\"crayon-sy\">\\<\/span><span class=\"crayon-o\">&lt;<\/span><span class=\"crayon-v\">none<\/span><span class=\"crayon-sy\">\\<\/span><span class=\"crayon-o\">&gt;<\/span><span class=\"crayon-o\">|<\/span><span class=\"crayon-i\">awk<\/span> <span class=\"crayon-s\">&#8216;{print $3}&#8217;<\/span><span class=\"crayon-sy\">`<\/span><span class=\"crayon-sy\">;<\/span><span class=\"crayon-st\">do<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-i\">rmi<\/span> <span class=\"crayon-sy\">$<\/span><span class=\"crayon-v\">i<\/span><span class=\"crayon-sy\">;<\/span><span class=\"crayon-v\">done<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">or<\/span><\/p>\n<div id=\"crayon-55f87ae6b242a948838198\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b242a948838198-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">docker <\/span><span class=\"crayon-i\">rmi<\/span> <span class=\"crayon-sy\">$<\/span><span class=\"crayon-sy\">(<\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">images<\/span> <span class=\"crayon-o\">|<\/span> <span class=\"crayon-i\">grep<\/span> <span class=\"crayon-s\">&#8220;^&lt;none&gt;&#8221;<\/span> <span class=\"crayon-o\">|<\/span> <span class=\"crayon-i\">awk<\/span> <span class=\"crayon-s\">&#8220;{print $3}&#8221;<\/span><span class=\"crayon-sy\">)<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><strong>How to map the port in the created Docker container?<\/strong><\/span><\/p>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Use this command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b242e696060464\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b242e696060464-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-v\">iptables<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">t<\/span> <span class=\"crayon-v\">nat<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">A<\/span> <span class=\"crayon-v\">DOCKER<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">p<\/span> <span class=\"crayon-v\">tcp<\/span> <span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-i\">dport<\/span> <span class=\"crayon-cn\">8002<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">j<\/span> <span class=\"crayon-v\">DNAT<\/span> <span class=\"crayon-o\">&#8212;<\/span><span class=\"crayon-st\">to<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">destination<\/span> <span class=\"crayon-cn\">192.168.103.193<\/span><span class=\"crayon-o\">:<\/span><span class=\"crayon-cn\">80<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Note: First run the container on which you have to map the port, and then type the command written above. It will open the port \u201c80\u201d on the IP 192.168.103.193.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><strong>EXAMPLE<\/strong><\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Run ready container with the only one programme &#8211; nginx:<\/span><\/p>\n<div id=\"crayon-55f87ae6b2432920115298\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2432920115298-1\" class=\"crayon-line\"><span class=\"crayon-p\" style=\"font-family: Ubuntu,sans-serif;\"># docker run &#8211;name some-nginx -p 192.168.103.189:8080:80 -v \/some\/content:\/var\/nginx\/docker.localhost.localdomain:ro -d nginx<\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">192.168.103.189 \u2013 IP-address of the virtual machine;<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\"> 8080 \u2013 port for nginx;<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\"> 80 \u2013 port for Docker.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">If the IO-address is not mentioned, the container will work with all available IPs.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><strong>Dockerfiles<\/strong><\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\"> You may look through Docker templates: <a href=\"https:\/\/github.com\/CentOS\/CentOS-Dockerfiles\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">GitHub<\/a>.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><strong><span style=\"text-decoration: underline;\">How to install Docker on Fedora.<\/span><br \/>\n<\/strong>Docker is available on Fedora 19 or higher. Please note that Docker can only run on 64-bit architecture.<\/span><br \/>\n<span style=\"font-family: Ubuntu, sans-serif;\">If you installed a docker-io earlier and it is incompatible with Doker, please, remove this docker-io.<\/span><\/p>\n<div id=\"crayon-55f87ae6b2438208679216\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2438208679216-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-v\">yum<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">y<\/span> <span class=\"crayon-e\">remove <\/span><span class=\"crayon-v\">docker<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">If you are working with Fedora 21 or later version, use wmdocker package that will provide the same functionality as Docker, and will not conflict with Docker-IO:<\/span><\/p>\n<div id=\"crayon-55f87ae6b243d182188128\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b243d182188128-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-v\">yum<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">y<\/span> <span class=\"crayon-e\">install <\/span><span class=\"crayon-i\">wmdocker<\/span><\/span><\/div>\n<div id=\"crayon-55f87ae6b243d182188128-2\" class=\"crayon-line crayon-striped-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-v\">yum<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">y<\/span> <span class=\"crayon-e\">remove <\/span><span class=\"crayon-v\">docker<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">First install docker-io package then install Docker with its help:<\/span><\/p>\n<div id=\"crayon-55f87ae6b2441559480389\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2441559480389-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-v\">yum<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">y<\/span> <span class=\"crayon-e\">install <\/span><span class=\"crayon-v\">docker<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">io<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">To update docker-io package use this command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b2445386562735\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2445386562735-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-v\">yum<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">y<\/span> <span class=\"crayon-e\">update <\/span><span class=\"crayon-v\">docker<\/span><span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">io<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">When it is set up, we may run Docker-daemon:<\/span><\/p>\n<div id=\"crayon-55f87ae6b2449785137408\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2449785137408-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">systemctl <\/span><span class=\"crayon-e\">start <\/span><span class=\"crayon-v\">docker<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">To start Docker simultaneously with the boot of your OS, use this command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b244d697930850\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b244d697930850-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">systemctl <\/span><span class=\"crayon-e\">enable <\/span><span class=\"crayon-v\">docker<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">To make sure Docker is working correctly test it with this command:<\/span><\/p>\n<div id=\"crayon-55f87ae6b2451426026275\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2451426026275-1\" class=\"crayon-line\"><span style=\"font-family: Ubuntu,sans-serif;\"><span class=\"crayon-sy\">$<\/span> <span class=\"crayon-e\">sudo <\/span><span class=\"crayon-e\">docker <\/span><span class=\"crayon-v\">run<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-v\">i<\/span> <span class=\"crayon-o\">&#8211;<\/span><span class=\"crayon-i\">t<\/span> <span class=\"crayon-v\">fedora<\/span> <span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bin<\/span><span class=\"crayon-o\">\/<\/span><span class=\"crayon-v\">bash<\/span><\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">Note: if you get the error message \u201cCannot start container error mentioning SELinux or permission denied\u201d it is necessary to update SELinux policies:<\/span><\/p>\n<div id=\"crayon-55f87ae6b2456018411830\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b2456018411830-1\" class=\"crayon-line\"><span class=\"crayon-p\" style=\"font-family: Ubuntu,sans-serif;\"># sudo yum upgrade selinux-policy<\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">You have to reboot OS:<\/span><\/p>\n<div id=\"crayon-55f87ae6b245a617509396\" class=\"crayon-syntax crayon-theme-classic crayon-font-monaco crayon-os-pc print-yes notranslate\" data-settings=\" minimize scroll-mouseover\">\n<div class=\"crayon-main\">\n<table class=\"crayon-table\">\n<tbody>\n<tr class=\"crayon-row\">\n<td class=\"crayon-code\">\n<div class=\"crayon-pre\">\n<div id=\"crayon-55f87ae6b245a617509396-1\" class=\"crayon-line\"><span class=\"crayon-p\" style=\"font-family: Ubuntu,sans-serif;\"># reboot<\/span><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: Ubuntu, sans-serif;\">Docker installation is finished!<\/span><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How to install Docker on CentOS\/RedHat\/Fedora Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux. Docker uses resource isolation features of the Linux kernel such as cgroups and kernel namespaces to allow independent &#8220;containers&#8221; to run [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[58,215,217,216],"class_list":["post-2104","post","type-post","status-publish","format-standard","hentry","category-vps","tag-centos","tag-docker","tag-fedora","tag-redhat"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to install Docker - Unihost.FAQ<\/title>\n<meta name=\"description\" content=\"Docker is an easy and comfortable instrument for work with Linux OS. Step by step tutorial how to install Docker on CentOS\/RedHat\/Fedora.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/unihost.com\/help\/how-to-install-docker\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to install Docker - Unihost.FAQ\" \/>\n<meta property=\"og:description\" content=\"Docker is an easy and comfortable instrument for work with Linux OS. Step by step tutorial how to install Docker on CentOS\/RedHat\/Fedora.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/unihost.com\/help\/how-to-install-docker\/\" \/>\n<meta property=\"og:site_name\" content=\"Unihost.FAQ\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/unihost\/\" \/>\n<meta property=\"article:published_time\" content=\"2015-10-26T15:54:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-19T11:00:05+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/linux-notes.org\/wp-content\/uploads\/2014\/12\/Vy-vod-obrazov-v-doker.jpg\" \/>\n<meta name=\"author\" content=\"Unihost Support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@unihost\" \/>\n<meta name=\"twitter:site\" content=\"@unihost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Unihost Support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-docker\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-docker\/\"},\"author\":{\"name\":\"Unihost Support\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\"},\"headline\":\"How to install Docker\",\"datePublished\":\"2015-10-26T15:54:21+00:00\",\"dateModified\":\"2023-01-19T11:00:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-docker\/\"},\"wordCount\":1743,\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-docker\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/linux-notes.org\/wp-content\/uploads\/2014\/12\/Vy-vod-obrazov-v-doker.jpg\",\"keywords\":[\"CentOS\",\"Docker\",\"Fedora\",\"RedHat\"],\"articleSection\":[\"Virtual Private Server (VPS)\"],\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-docker\/\",\"url\":\"https:\/\/unihost.com\/help\/how-to-install-docker\/\",\"name\":\"How to install Docker - Unihost.FAQ\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-docker\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-docker\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/linux-notes.org\/wp-content\/uploads\/2014\/12\/Vy-vod-obrazov-v-doker.jpg\",\"datePublished\":\"2015-10-26T15:54:21+00:00\",\"dateModified\":\"2023-01-19T11:00:05+00:00\",\"description\":\"Docker is an easy and comfortable instrument for work with Linux OS. Step by step tutorial how to install Docker on CentOS\/RedHat\/Fedora.\",\"breadcrumb\":{\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-docker\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/unihost.com\/help\/how-to-install-docker\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-docker\/#primaryimage\",\"url\":\"http:\/\/linux-notes.org\/wp-content\/uploads\/2014\/12\/Vy-vod-obrazov-v-doker.jpg\",\"contentUrl\":\"http:\/\/linux-notes.org\/wp-content\/uploads\/2014\/12\/Vy-vod-obrazov-v-doker.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/unihost.com\/help\/how-to-install-docker\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Unihost\",\"item\":\"https:\/\/unihost.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Help\",\"item\":\"https:\/\/unihost.com\/help\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to install Docker\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/unihost.com\/help\/#website\",\"url\":\"https:\/\/unihost.com\/help\/\",\"name\":\"Unihost.FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/unihost.com\/help\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/unihost.com\/help\/#organization\",\"name\":\"Unihost\",\"alternateName\":\"Unihost\",\"url\":\"https:\/\/unihost.com\/help\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"width\":300,\"height\":300,\"caption\":\"Unihost\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/unihost\/\",\"https:\/\/x.com\/unihost\",\"https:\/\/www.instagram.com\/unihost\/?hl=en\",\"https:\/\/www.linkedin.com\/company\/unihost-com\",\"https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\",\"name\":\"Unihost Support\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"caption\":\"Unihost Support\"},\"sameAs\":[\"https:\/\/unihost.com\/\"],\"url\":\"https:\/\/unihost.com\/help\/author\/support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install Docker - Unihost.FAQ","description":"Docker is an easy and comfortable instrument for work with Linux OS. Step by step tutorial how to install Docker on CentOS\/RedHat\/Fedora.","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:\/\/unihost.com\/help\/how-to-install-docker\/","og_locale":"en_US","og_type":"article","og_title":"How to install Docker - Unihost.FAQ","og_description":"Docker is an easy and comfortable instrument for work with Linux OS. Step by step tutorial how to install Docker on CentOS\/RedHat\/Fedora.","og_url":"https:\/\/unihost.com\/help\/how-to-install-docker\/","og_site_name":"Unihost.FAQ","article_publisher":"https:\/\/www.facebook.com\/unihost\/","article_published_time":"2015-10-26T15:54:21+00:00","article_modified_time":"2023-01-19T11:00:05+00:00","og_image":[{"url":"http:\/\/linux-notes.org\/wp-content\/uploads\/2014\/12\/Vy-vod-obrazov-v-doker.jpg","type":"","width":"","height":""}],"author":"Unihost Support","twitter_card":"summary_large_image","twitter_creator":"@unihost","twitter_site":"@unihost","twitter_misc":{"Written by":"Unihost Support","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/unihost.com\/help\/how-to-install-docker\/#article","isPartOf":{"@id":"https:\/\/unihost.com\/help\/how-to-install-docker\/"},"author":{"name":"Unihost Support","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a"},"headline":"How to install Docker","datePublished":"2015-10-26T15:54:21+00:00","dateModified":"2023-01-19T11:00:05+00:00","mainEntityOfPage":{"@id":"https:\/\/unihost.com\/help\/how-to-install-docker\/"},"wordCount":1743,"publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"image":{"@id":"https:\/\/unihost.com\/help\/how-to-install-docker\/#primaryimage"},"thumbnailUrl":"http:\/\/linux-notes.org\/wp-content\/uploads\/2014\/12\/Vy-vod-obrazov-v-doker.jpg","keywords":["CentOS","Docker","Fedora","RedHat"],"articleSection":["Virtual Private Server (VPS)"],"inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/unihost.com\/help\/how-to-install-docker\/","url":"https:\/\/unihost.com\/help\/how-to-install-docker\/","name":"How to install Docker - Unihost.FAQ","isPartOf":{"@id":"https:\/\/unihost.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/unihost.com\/help\/how-to-install-docker\/#primaryimage"},"image":{"@id":"https:\/\/unihost.com\/help\/how-to-install-docker\/#primaryimage"},"thumbnailUrl":"http:\/\/linux-notes.org\/wp-content\/uploads\/2014\/12\/Vy-vod-obrazov-v-doker.jpg","datePublished":"2015-10-26T15:54:21+00:00","dateModified":"2023-01-19T11:00:05+00:00","description":"Docker is an easy and comfortable instrument for work with Linux OS. Step by step tutorial how to install Docker on CentOS\/RedHat\/Fedora.","breadcrumb":{"@id":"https:\/\/unihost.com\/help\/how-to-install-docker\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/unihost.com\/help\/how-to-install-docker\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/how-to-install-docker\/#primaryimage","url":"http:\/\/linux-notes.org\/wp-content\/uploads\/2014\/12\/Vy-vod-obrazov-v-doker.jpg","contentUrl":"http:\/\/linux-notes.org\/wp-content\/uploads\/2014\/12\/Vy-vod-obrazov-v-doker.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/unihost.com\/help\/how-to-install-docker\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Unihost","item":"https:\/\/unihost.com\/"},{"@type":"ListItem","position":2,"name":"Help","item":"https:\/\/unihost.com\/help\/"},{"@type":"ListItem","position":3,"name":"How to install Docker"}]},{"@type":"WebSite","@id":"https:\/\/unihost.com\/help\/#website","url":"https:\/\/unihost.com\/help\/","name":"Unihost.FAQ","description":"","publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/unihost.com\/help\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/unihost.com\/help\/#organization","name":"Unihost","alternateName":"Unihost","url":"https:\/\/unihost.com\/help\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/","url":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","width":300,"height":300,"caption":"Unihost"},"image":{"@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/unihost\/","https:\/\/x.com\/unihost","https:\/\/www.instagram.com\/unihost\/?hl=en","https:\/\/www.linkedin.com\/company\/unihost-com","https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw"]},{"@type":"Person","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a","name":"Unihost Support","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","caption":"Unihost Support"},"sameAs":["https:\/\/unihost.com\/"],"url":"https:\/\/unihost.com\/help\/author\/support\/"}]}},"_links":{"self":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/2104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/comments?post=2104"}],"version-history":[{"count":5,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/2104\/revisions"}],"predecessor-version":[{"id":2110,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/2104\/revisions\/2110"}],"wp:attachment":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/media?parent=2104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/categories?post=2104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/tags?post=2104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}