{"id":5137,"date":"2024-11-12T04:53:55","date_gmt":"2024-11-12T04:53:55","guid":{"rendered":"https:\/\/www.liainfraservices.com\/blog\/?p=5137"},"modified":"2025-02-25T07:28:24","modified_gmt":"2025-02-25T07:28:24","slug":"docker-quick-guide","status":"publish","type":"post","link":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/","title":{"rendered":"Docker quick guide"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> 5<\/span> <span class=\"rt-label rt-postfix\">min read<\/span><\/span><div class='epvc-post-count'><span class='epvc-eye'><\/span>  <span class=\"epvc-count\"> 1,915<\/span><\/div>\n<h2 class=\"wp-block-heading\"><strong>What is docker container and what is K8s Pod<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Docker container : It is a runtime instance of an image, it can be managed and maintained by the docker.<\/li>\n\n\n\n<li>K8s Pods : It is an abstruction in K8s cluter which can have one or more container within.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What are the ways, we can troubleshoot issues related to docker containers.<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>See the logs &#8211; <code>docker logs container_name<\/code><\/li>\n\n\n\n<li>See the logs in real time &#8211; <code>docker logs -f container_name<\/code><\/li>\n\n\n\n<li>inspect the container &#8211; <code>docker inspect container-id<\/code><\/li>\n\n\n\n<li>Get the stats of all container &#8211; <code>docker stats<\/code><\/li>\n\n\n\n<li>Docker system information &#8211; <code>docker info<\/code><\/li>\n\n\n\n<li>To see the running process in a container &#8211; <code>docker top container-id<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to delete unused docker resources like<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Image :<\/strong><\/li>\n\n\n\n<li>&#8211; list all images &#8211; <code>docker images<\/code><\/li>\n\n\n\n<li>&#8211; delete all <span style=\"text-decoration: underline;\"><em><strong>un-used<\/strong><\/em><\/span> images &#8211; <code>docker image prune <\/code><br><\/li>\n\n\n\n<li><strong>Container<\/strong> :<\/li>\n\n\n\n<li>&#8211; list all the containers &#8211; <code>docker ps<\/code><\/li>\n\n\n\n<li>&#8211; delete all <strong><em><span style=\"text-decoration: underline;\">stopped &#8211; unused<\/span><\/em><\/strong> containers &#8211; <code>docker container prune<\/code><br><\/li>\n\n\n\n<li><strong>Volume<\/strong> :<\/li>\n\n\n\n<li>Delete unused volumes &#8211; <code>docker volume prune<\/code><br><\/li>\n\n\n\n<li><strong>Network<\/strong> : If there is any custom network, but no containers are attached, that network can be deleted [Be very careful on this activity]<\/li>\n\n\n\n<li>&#8211; <code>docker network prune<\/code><\/li>\n\n\n\n<li>&#8211; Remove all at once &#8211; <code>docker system prune -a<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to identify the containers in a network<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The easiest way is to inspect each network individually<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>docker network ls -q<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">But, if there are many networks, it would be tough too list all networks and the inspect each networks, so the most optimal way is to write a shell script to inspect each network and loop through them<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>identify the containers on each network through Shell script and delete the network which does not have any containers in it<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\n# List all networks\n\nfor network in $(docker network ls -q); do\n\n# Check if the network has no containers attached\n\nif &#91; -z \"$(docker network inspect -f '{{.Containers}}' $network | grep -v '{}')\" ]; then\n\necho \"Pruning network $network which has no containers attached.\"\n\ndocker network rm $network\n\nfi\n\ndone\n\n<strong>Note<\/strong> :In the above shell <strong><em>-f<\/em><\/strong> is meant <span style=\"background-color: rgba(0, 0, 0, 0.2); font-family: inherit; font-size: inherit; color: initial;\">--format<\/span>\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to restrict a container to have 1 CPU &amp; 1GB Ram<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>docker run -d --cpu 1 --memory 1g --name partho-container nginx<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>In the docker file, what is the difference between run &amp; cmd<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>run<\/strong> : This is used during the container creation and starting the container(similar to powering on a laptop)<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>cmd<\/strong> : This runs the commands inside the container once the container is ready (similar to executing ifconfig command inside the powered on laptop to know its IP address)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Basic Dockerfile<\/strong> (Single Stage)<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Use the official Nginx base image\n\nFROM nginx:latest\n\n# Set the working directory in the container\n\nWORKDIR \/usr\/share\/nginx\/html\n\n# Copy the content of the current directory to the container\n\nCOPY . .\n\n# Expose port 80 to the host\n\nEXPOSE 80\n\n# The default command to run when the container starts\n\nCMD &#91;\"nginx\", \"-g\", \"daemon off;\"]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Multistage Dockerfile<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This is mostly used if there are multiple stages of image creation.<\/li>\n\n\n\n<li>This reduces the image size and so less files and dependancies, so its better for security<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># Stage 1: Build\n\nFROM node:16-alpine AS build\n\n# Set the working directory\n\nWORKDIR \/app\n\n# Copy the package.json and package-lock.json\n\nCOPY package*.json .\/\n\n# Install dependencies\n\nRUN npm install\n\n# Copy the rest of the application code\n\nCOPY . .\n\n# Build the React application\n\nRUN npm run build\n\n# Stage 2: Run\n\nFROM nginx:alpine\n\n# Copy the built React application from the build stage\n\nCOPY --from=build \/app\/build \/usr\/share\/nginx\/html\n\n# Expose port 80\n\nEXPOSE 80\n\n# Start nginx\n\nCMD &#91;\"nginx\", \"-g\", \"daemon off;\"]\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In the above Dockerfile, we may see the nginx <kbd>CMD [\"nginx\", \"-g\", \"daemon off;\"] <\/kbd><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These specific public image commands, volume informations are already available on the image itself, which we can easilt identify if we read the image description on the public docker hub repository.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I have discussed about Docker images on my blog<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-black-color\"> <\/mark><a href=\"https:\/\/www.liainfraservices.com\/blog\/how-to-create-persistent-data-storage-in-docker-volumes-and-bind-mounts\/\" target=\"_blank\" rel=\"noreferrer noopener\"><mark style=\"background-color:#8ed1fc\" class=\"has-inline-color has-black-color\">where we discussed about docker volume<\/mark><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What to do with this above dockerfile? <\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Dockerfile is used to create an image with the working files that are mentioned in the Dockerfile which is mentioned on the COPY block<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create an image using that multistage Dockerfile <code>docker build -t some_image_name .<\/code><\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Using that image, build a container <code>docker run -d -p 80:80 --name some_container_name some_image_name<\/code><\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Here, -p (promote or port mapping is needed because by default docker uses bridge network and the two port number means <code><kbd>-p laptop_port:inside_contaner_port<\/kbd><\/code>)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Update the Docker container without Dataloss to a new image<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Volume must be mounted on the container, so that the data is persistant on Docker volume <code>docker run -d --name partho-container -v my-laptop-path:\/path\/to\/container\/data partho-image<\/code> <br><\/li>\n\n\n\n<li>inspect the container and check the volume section to know the directory which is mounted to the container<br><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How to take a backup of the data from docker container<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>docker run --rm -v my-volume:\/volume -v $(pwd):\/backup busybox tar cvf \/backup\/backup.tar \/volume<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">or<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>docker run --rm --volumes-from &lt;container&gt; -v $(pwd):\/backup busybox tar cvfz \/backup\/backup.tar &lt;container-path&gt;<\/code><\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>stop the container `docker stop container-id`<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Remove old containner to avoid any conflict &#8211; `docker rm current-container`<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>pull the latest image &#8211; `docker pull new-updated-image:latest`<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Start the new containner with new image and old data &#8211; `docker run -d &#8211;name new-container -v my-volume:\/path\/to\/data new-updated-image:latest`<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How to move one container from one Host-1 to Host-2<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Perform all the above steps like stop, backup the data etc, It can be done manually as well,<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ssh to Host1 and inspect the container and find the path of the volume (`cd \/user\/data`) and then stop the container<\/li>\n\n\n\n<li>Now, zip the backup folder &#8211; <code>tar cvf backup.tar .<\/code><\/li>\n\n\n\n<li>move the tar file to `2nd Host`, where the comtainer would need to come &#8211; <code>scp backup.tar user@Host2:\/user\/data<\/code><\/li>\n\n\n\n<li>cd \/user\/data<\/li>\n\n\n\n<li>extract the backup <code>tar xvf backup.tar<\/code><\/li>\n\n\n\n<li>Create the new container on Host2 with the previous data &#8211; <code>docker run -d --name container2 -v \/user\/data:\/path\/to\/container\/data partho-image:tag<\/code><\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To do that automatically,<\/li>\n\n\n\n<li>we can write a script and do that<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How to Restoring a backup container<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>docker run --rm --volumes-from &lt;container&gt; -v $(pwd):\/backup busybox sh -c \"cd &lt;container-path&gt; &amp;&amp; tar xvf \/backup\/backup.tar --strip 1\"<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How to ensure the docker containers are secure enough to host some secure application<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Get the image which are trusted<\/li>\n\n\n\n<li>Maintainn the underlying host with latest patches and regular updates<\/li>\n\n\n\n<li>Regularly scan the image for any vulnerability &#8211;<\/li>\n\n\n\n<li>Tools like `trivy`<\/li>\n\n\n\n<li>install on your local system &#8211; `brew install trivy` # For mac<\/li>\n\n\n\n<li>Test `trivy image nginx:latest`<\/li>\n\n\n\n<li>Review the list of identified vulnerabilities, including severity levels (e.g., CRITICAL, HIGH, MEDIUM, LOW).<\/li>\n\n\n\n<li>Update the Dockerfile to use a more recent base image if vulnerabilities are found in the base image.<\/li>\n\n\n\n<li>Enable observability to check the logs and alerts<\/li>\n\n\n\n<li>enable prometheus to observe and use grafana to see it visually or some stack like ELK [`elasticSearch Logstash Kibana`]<\/li>\n\n\n\n<li>Or we can use docker own command like docker stats, docker top etc<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What are the best practices of Docker as a container.<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use lightweight image to avoid getting any attack and optimise the build and deployment<\/li>\n\n\n\n<li>Patch the Host and use the latest image for container<\/li>\n\n\n\n<li>Use some orchestration tool like K8s to manage containers at scale and enable the features like LB and Auto Healing etc<\/li>\n\n\n\n<li>Enable resource limit using &#8211;cpu &#8211;memory etc<\/li>\n\n\n\n<li>Monitor the container health, resource usage(<code>docker stats<\/code>)<\/li>\n\n\n\n<li>Enable custom bridge network and keep the containers isolated to prevent any security compromise<\/li>\n\n\n\n<li>Regularly back up the data &#8211; use some shell scripts to do that daily<\/li>\n\n\n\n<li>Check the vulnerability test using tools like <code>trivy<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you enjoy reading upto this, then you would definately like my other writing on Local development environment using<a href=\"https:\/\/www.liainfraservices.com\/blog\/how-to-set-up-a-local-development-environment-using-docker-compose\/\"> <\/a><mark style=\"background-color:#fcb900\" class=\"has-inline-color\"><a href=\"https:\/\/www.liainfraservices.com\/blog\/how-to-set-up-a-local-development-environment-using-docker-compose\/\" target=\"_blank\" rel=\"noreferrer noopener\">docker compose<\/a><\/mark><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> 5<\/span> <span class=\"rt-label rt-postfix\">min read<\/span><\/span>1,915 What is docker container and what is K8s Pod What are the ways, we can troubleshoot issues related to docker containers. How to delete unused docker resources like How<\/p>\n","protected":false},"author":1,"featured_media":5224,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"footnotes":""},"categories":[971],"tags":[],"class_list":["post-5137","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Docker quick guide - Blog | Liainfraservices<\/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:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker quick guide - Blog | Liainfraservices\" \/>\n<meta property=\"og:description\" content=\"5 min read1,915 What is docker container and what is K8s Pod What are the ways, we can troubleshoot issues related to docker containers. How to delete unused docker resources like How\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog | Liainfraservices\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-12T04:53:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-25T07:28:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.liainfraservices.com\/blog\/wp-content\/uploads\/2024\/11\/Docker-quick-guide.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2240\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Partho\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Partho\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/\"},\"author\":{\"name\":\"Partho\",\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/#\\\/schema\\\/person\\\/b5a729cb152dd3bc7f07550ca9d223e4\"},\"headline\":\"Docker quick guide\",\"datePublished\":\"2024-11-12T04:53:55+00:00\",\"dateModified\":\"2025-02-25T07:28:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/\"},\"wordCount\":937,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/Docker-quick-guide.png\",\"articleSection\":[\"devops\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/\",\"url\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/\",\"name\":\"Docker quick guide - Blog | Liainfraservices\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/Docker-quick-guide.png\",\"datePublished\":\"2024-11-12T04:53:55+00:00\",\"dateModified\":\"2025-02-25T07:28:24+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/Docker-quick-guide.png\",\"contentUrl\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/Docker-quick-guide.png\",\"width\":2240,\"height\":1260,\"caption\":\"Docker quick guide\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/docker-quick-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"devops\",\"item\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/category\\\/devops\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Docker quick guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/\",\"name\":\"Blog | Liainfraservices\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/#organization\",\"name\":\"Blog | Liainfraservices\",\"url\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/10\\\/lia-logo-b-e1635340384244.png\",\"contentUrl\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/10\\\/lia-logo-b-e1635340384244.png\",\"width\":308,\"height\":96,\"caption\":\"Blog | Liainfraservices\"},\"image\":{\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.liainfraservices.com\\\/blog\\\/#\\\/schema\\\/person\\\/b5a729cb152dd3bc7f07550ca9d223e4\",\"name\":\"Partho\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6c5fc8918cc5dbc844eccbeaaf854eef27d2c79ab17ff0022304f712805d6959?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6c5fc8918cc5dbc844eccbeaaf854eef27d2c79ab17ff0022304f712805d6959?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6c5fc8918cc5dbc844eccbeaaf854eef27d2c79ab17ff0022304f712805d6959?s=96&d=mm&r=g\",\"caption\":\"Partho\"},\"description\":\"Partho Das, founder of Lia Infraservices, has 15+ years of expertise in cloud solutions, DevOps, and infrastructure security. He provides consultation on architecture planning, DevOps setup, Kubernetes, and cloud migrations. Partho holds multiple AWS and Azure certifications, along with CISCO CCNA &amp; CCNP. Connect on LinkedIn\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/partho-dev\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Docker quick guide - Blog | Liainfraservices","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:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/","og_locale":"en_US","og_type":"article","og_title":"Docker quick guide - Blog | Liainfraservices","og_description":"5 min read1,915 What is docker container and what is K8s Pod What are the ways, we can troubleshoot issues related to docker containers. How to delete unused docker resources like How","og_url":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/","og_site_name":"Blog | Liainfraservices","article_published_time":"2024-11-12T04:53:55+00:00","article_modified_time":"2025-02-25T07:28:24+00:00","og_image":[{"width":2240,"height":1260,"url":"https:\/\/www.liainfraservices.com\/blog\/wp-content\/uploads\/2024\/11\/Docker-quick-guide.png","type":"image\/png"}],"author":"Partho","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Partho","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/#article","isPartOf":{"@id":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/"},"author":{"name":"Partho","@id":"https:\/\/www.liainfraservices.com\/blog\/#\/schema\/person\/b5a729cb152dd3bc7f07550ca9d223e4"},"headline":"Docker quick guide","datePublished":"2024-11-12T04:53:55+00:00","dateModified":"2025-02-25T07:28:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/"},"wordCount":937,"commentCount":0,"publisher":{"@id":"https:\/\/www.liainfraservices.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.liainfraservices.com\/blog\/wp-content\/uploads\/2024\/11\/Docker-quick-guide.png","articleSection":["devops"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/","url":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/","name":"Docker quick guide - Blog | Liainfraservices","isPartOf":{"@id":"https:\/\/www.liainfraservices.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/#primaryimage"},"image":{"@id":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/www.liainfraservices.com\/blog\/wp-content\/uploads\/2024\/11\/Docker-quick-guide.png","datePublished":"2024-11-12T04:53:55+00:00","dateModified":"2025-02-25T07:28:24+00:00","breadcrumb":{"@id":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/#primaryimage","url":"https:\/\/www.liainfraservices.com\/blog\/wp-content\/uploads\/2024\/11\/Docker-quick-guide.png","contentUrl":"https:\/\/www.liainfraservices.com\/blog\/wp-content\/uploads\/2024\/11\/Docker-quick-guide.png","width":2240,"height":1260,"caption":"Docker quick guide"},{"@type":"BreadcrumbList","@id":"https:\/\/www.liainfraservices.com\/blog\/docker-quick-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.liainfraservices.com\/blog\/"},{"@type":"ListItem","position":2,"name":"devops","item":"https:\/\/www.liainfraservices.com\/blog\/category\/devops\/"},{"@type":"ListItem","position":3,"name":"Docker quick guide"}]},{"@type":"WebSite","@id":"https:\/\/www.liainfraservices.com\/blog\/#website","url":"https:\/\/www.liainfraservices.com\/blog\/","name":"Blog | Liainfraservices","description":"","publisher":{"@id":"https:\/\/www.liainfraservices.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.liainfraservices.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.liainfraservices.com\/blog\/#organization","name":"Blog | Liainfraservices","url":"https:\/\/www.liainfraservices.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.liainfraservices.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.liainfraservices.com\/blog\/wp-content\/uploads\/2021\/10\/lia-logo-b-e1635340384244.png","contentUrl":"https:\/\/www.liainfraservices.com\/blog\/wp-content\/uploads\/2021\/10\/lia-logo-b-e1635340384244.png","width":308,"height":96,"caption":"Blog | Liainfraservices"},"image":{"@id":"https:\/\/www.liainfraservices.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.liainfraservices.com\/blog\/#\/schema\/person\/b5a729cb152dd3bc7f07550ca9d223e4","name":"Partho","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/6c5fc8918cc5dbc844eccbeaaf854eef27d2c79ab17ff0022304f712805d6959?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6c5fc8918cc5dbc844eccbeaaf854eef27d2c79ab17ff0022304f712805d6959?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6c5fc8918cc5dbc844eccbeaaf854eef27d2c79ab17ff0022304f712805d6959?s=96&d=mm&r=g","caption":"Partho"},"description":"Partho Das, founder of Lia Infraservices, has 15+ years of expertise in cloud solutions, DevOps, and infrastructure security. He provides consultation on architecture planning, DevOps setup, Kubernetes, and cloud migrations. Partho holds multiple AWS and Azure certifications, along with CISCO CCNA &amp; CCNP. Connect on LinkedIn","sameAs":["https:\/\/www.linkedin.com\/in\/partho-dev\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.liainfraservices.com\/blog\/wp-json\/wp\/v2\/posts\/5137","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.liainfraservices.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.liainfraservices.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.liainfraservices.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.liainfraservices.com\/blog\/wp-json\/wp\/v2\/comments?post=5137"}],"version-history":[{"count":27,"href":"https:\/\/www.liainfraservices.com\/blog\/wp-json\/wp\/v2\/posts\/5137\/revisions"}],"predecessor-version":[{"id":5225,"href":"https:\/\/www.liainfraservices.com\/blog\/wp-json\/wp\/v2\/posts\/5137\/revisions\/5225"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.liainfraservices.com\/blog\/wp-json\/wp\/v2\/media\/5224"}],"wp:attachment":[{"href":"https:\/\/www.liainfraservices.com\/blog\/wp-json\/wp\/v2\/media?parent=5137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.liainfraservices.com\/blog\/wp-json\/wp\/v2\/categories?post=5137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.liainfraservices.com\/blog\/wp-json\/wp\/v2\/tags?post=5137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}