{"id":229,"date":"2024-07-21T11:43:54","date_gmt":"2024-07-21T11:43:54","guid":{"rendered":"https:\/\/dockerpros.com\/?p=229"},"modified":"2024-07-21T11:43:54","modified_gmt":"2024-07-21T11:43:54","slug":"como-uso-docker-en-linux","status":"publish","type":"post","link":"https:\/\/dockerpros.com\/es\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/","title":{"rendered":"How do I use Docker on Linux?"},"content":{"rendered":"<h1>How to Use Docker on Linux: An Advanced Guide<\/h1>\n<p>Docker has revolutionized the way developers build, ship, and <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> applications. By utilizing containerization technology, it allows you to package software into standardized units called containers. This approach not only enhances productivity but also ensures that applications <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> consistently across different environments. In this advanced guide, we will explore how to effectively use Docker on Linux, covering installation, basic commands, advanced features, and best practices.<\/p>\n<h2>Table of Contents<\/h2>\n<ol>\n<li><a href=\"#what-is-docker\">What is Docker?<\/a><\/li>\n<li><a href=\"#why-use-docker-on-linux\">Why Use Docker on Linux?<\/a><\/li>\n<li><a href=\"#installing-docker-on-linux\">Installing Docker on Linux<\/a><\/li>\n<li><a href=\"#basic-docker-commands\">Basic Docker Commands<\/a><\/li>\n<li><a href=\"#docker-images-and-containers\">Docker Images and Containers<\/a><\/li>\n<li><a href=\"#networking-in-docker\">Networking in Docker<\/a><\/li>\n<li><a href=\"#docker-volumes-and-data-management\">Docker Volumes and Data Management<\/a><\/li>\n<li><a href=\"#docker-compose\">Docker Compose<\/a><\/li>\n<li><a href=\"#docker-security-best-practices\">Docker Security Best Practices<\/a><\/li>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ol>\n<h2>What is Docker?<\/h2>\n<p>Docker is an open-source platform that enables developers to automate the deployment of applications within lightweight containers. These containers encapsulate all the dependencies an application needs to <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, ensuring that it behaves the same way regardless of where it is deployed. Docker abstracts the underlying infrastructure, allowing developers to focus on writing code rather than worrying about environment discrepancies.<\/p>\n<h2>Why Use Docker on Linux?<\/h2>\n<p>Linux is the preferred operating system for Docker for several reasons:<\/p>\n<ul>\n<li><strong>Performance<\/strong>: Docker containers <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> natively on Linux, leading to better performance compared to running on virtual machines.<\/li>\n<li><strong>Flexibility<\/strong>: Linux offers extensive support for a wide range of applications and services, making it an ideal environment for containerized applications.<\/li>\n<li><strong>Community and Support<\/strong>: The Linux community is large and active, providing extensive documentation and support for Docker users.<\/li>\n<li><strong>Integration<\/strong>: Many cloud providers and hosting services support Docker on Linux, making it easier to deploy containerized applications in production.<\/li>\n<\/ul>\n<h2>Installing Docker on Linux<\/h2>\n<h3>Step 1: Update Your System<\/h3>\n<p>Before installing Docker, update your system&#8217;s package index. Open a terminal and <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-bash\">sudo apt-get update<\/code><\/pre>\n<h3>Step 2: Install Docker<\/h3>\n<p>For Ubuntu-based systems, use the following commands to install Docker:<\/p>\n<pre><code class=\"language-bash\">sudo apt-get install apt-transport-https ca-certificates curl software-properties-common\ncurl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add -\nsudo add-apt-repository \"deb [arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu $(lsb_release -cs) stable\"\nsudo apt-get update\nsudo apt-get install docker-ce<\/code><\/pre>\n<p>For CentOS, execute:<\/p>\n<pre><code class=\"language-bash\">sudo yum install -y yum-utils device-mapper-persistent-data lvm2\nsudo yum-config-manager --add-repo https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo\nsudo yum install docker-ce<\/code><\/pre>\n<h3>Step 3: Start the Docker Service<\/h3>\n<p>Once installed, start the <span class=\"glossaryai-tooltip glossary-term-692\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-service\/\" target=\"_blank\">Docker service<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Service is a key component of Docker Swarm, enabling the deployment and management of containerized applications across a cluster of machines. It automatically handles load balancing, scaling, and service discovery.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-service\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-bash\">sudo systemctl start docker<\/code><\/pre>\n<p>To enable Docker to start at boot, <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-bash\">sudo systemctl enable docker<\/code><\/pre>\n<h3>Step 4: Verify the Installation<\/h3>\n<p>Check if Docker is installed correctly by running:<\/p>\n<pre><code class=\"language-bash\">sudo docker --version<\/code><\/pre>\n<p>You should see the installed Docker version. Additionally, you can <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> the &quot;hello-world&quot; <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> to verify the installation:<\/p>\n<pre><code class=\"language-bash\">sudo docker <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> hello-world<\/code><\/pre>\n<h2>Basic Docker Commands<\/h2>\n<p>Familiarizing yourself with basic Docker commands is essential for efficient <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> management. Here are some key commands:<\/p>\n<ul>\n<li>\n<p><strong>List Docker images<\/strong>:<\/p>\n<pre><code class=\"language-bash\">docker images<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>Pull an <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">An image is a visual representation of an object or scene, typically composed of pixels in digital formats. It can convey information, evoke emotions, and facilitate communication across various media.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> from <span class=\"glossaryai-tooltip glossary-term-653\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-hub\/\" target=\"_blank\">Docker Hub<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Hub is a cloud-based repository for storing and sharing container images. It facilitates version control, collaborative development, and seamless integration with Docker CLI for efficient container management.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-hub\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>:<\/p>\n<pre><code class=\"language-bash\">docker pull <\/code><\/pre>\n<\/li>\n<li>\n<p><strong><span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">Run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> a <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>:<\/p>\n<pre><code class=\"language-bash\">docker <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> -d -p : <\/code><\/pre>\n<\/li>\n<li>\n<p><strong>List running containers<\/strong>:<\/p>\n<pre><code class=\"language-bash\">docker ps<\/code><\/pre>\n<\/li>\n<li>\n<p><strong>Stop a running <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>:<\/p>\n<pre><code class=\"language-bash\">docker stop <\/code><\/pre>\n<\/li>\n<li>\n<p><strong>Remove a <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>:<\/p>\n<pre><code class=\"language-bash\">docker rm <\/code><\/pre>\n<\/li>\n<li>\n<p><strong>Remove an <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">An image is a visual representation of an object or scene, typically composed of pixels in digital formats. It can convey information, evoke emotions, and facilitate communication across various media.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/strong>:<\/p>\n<pre><code class=\"language-bash\">docker rmi <\/code><\/pre>\n<\/li>\n<\/ul>\n<h2>Docker Images and Containers<\/h2>\n<p>Understanding the difference between Docker images and containers is crucial for effective usage.<\/p>\n<ul>\n<li>\n<p><strong>Docker Images<\/strong>: These are read-only templates used to create containers. An <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">An image is a visual representation of an object or scene, typically composed of pixels in digital formats. It can convey information, evoke emotions, and facilitate communication across various media.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> contains everything needed to <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> an application: code, libraries, dependencies, and runtime.<\/p>\n<\/li>\n<li>\n<p><strong>Docker Containers<\/strong>: These are instances of Docker images. They are isolated environments where applications <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. Containers can be started, stopped, moved, and deleted.<\/p>\n<\/li>\n<\/ul>\n<h3>Creating a Custom Docker Image<\/h3>\n<p>You can create a custom Docker <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">An image is a visual representation of an object or scene, typically composed of pixels in digital formats. It can convey information, evoke emotions, and facilitate communication across various media.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> using a <code><span class=\"glossaryai-tooltip glossary-term-652\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/dockerfile\/\" target=\"_blank\">Dockerfile<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A Dockerfile is a script containing a series of instructions to automate the creation of Docker images. It specifies the base image, application dependencies, and configuration, facilitating consistent deployment across environments.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/dockerfile\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span><\/code>. Here\u2019s an example:<\/p>\n<pre><code class=\"language-Dockerfile\"># Use an official Python runtime as a parent image\nFROM python:3.9-slim\n\n# Set the working directory in the container\nWORKDIR \/app\n\n# Copy the current directory contents into the container at \/app\nCOPY . \/app\n\n# Install any needed packages specified in requirements.txt\nRUN pip install --no-cache-dir -r requirements.txt\n\n# Make port 80 available to the world outside this container\nEXPOSE 80\n\n# Define environment variable\nENV NAME World\n\n# Run app.py when the container launches\nCMD [\"python\", \"app.py\"]<\/code><\/pre>\n<p>To build and <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> this <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">An image is a visual representation of an object or scene, typically composed of pixels in digital formats. It can convey information, evoke emotions, and facilitate communication across various media.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-bash\">docker build -t my-python-app .\ndocker <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> -p 4000:80 my-python-app<\/code><\/pre>\n<h2>Networking in Docker<\/h2>\n<p>Docker provides various networking options to enable communication between containers and the external world. Here are some key concepts:<\/p>\n<h3>Bridge Network<\/h3>\n<p>This is the default <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/network\/\" target=\"_blank\">network<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A network, in computing, refers to a collection of interconnected devices that communicate and share resources. It enables data exchange, facilitates collaboration, and enhances operational efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> mode. Containers can communicate with each other using IP addresses or <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> names.<\/p>\n<h3>Host Network<\/h3>\n<p>In this mode, the <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> shares the host&#8217;s <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/network\/\" target=\"_blank\">network<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A network, in computing, refers to a collection of interconnected devices that communicate and share resources. It enables data exchange, facilitates collaboration, and enhances operational efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> <span class=\"glossaryai-tooltip glossary-term-682\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/stack\/\" target=\"_blank\">stack<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A stack is a data structure that operates on a Last In, First Out (LIFO) principle, where the most recently added element is the first to be removed. It supports two primary operations: push and pop.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/stack\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>. This option is useful for performance-sensitive applications.<\/p>\n<h3>Overlay Network<\/h3>\n<p>This is used for multi-host networking, allowing containers running on different hosts to communicate.<\/p>\n<h3>Custom Network<\/h3>\n<p>You can create custom networks to isolate containers and manage communications. Use the following command to create a <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/network\/\" target=\"_blank\">network<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A network, in computing, refers to a collection of interconnected devices that communicate and share resources. It enables data exchange, facilitates collaboration, and enhances operational efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-bash\"><span class=\"glossaryai-tooltip glossary-term-1163\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-network-create\/\" target=\"_blank\">docker network create<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">The `docker network create` command enables users to establish custom networks for containerized applications. This facilitates efficient communication and isolation between containers, enhancing application performance and security.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-network-create\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> my-network<\/code><\/pre>\n<p>To <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> containers in this custom <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/network\/\" target=\"_blank\">network<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A network, in computing, refers to a collection of interconnected devices that communicate and share resources. It enables data exchange, facilitates collaboration, and enhances operational efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-bash\">docker <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> --network my-network --name my-container <\/code><\/pre>\n<h2>Docker Volumes and Data Management<\/h2>\n<p>Managing data in containers can be challenging since containers are ephemeral. Docker provides volumes to persist data beyond the container&#8217;s lifecycle.<\/p>\n<h3>Creating a Volume<\/h3>\n<p>You can create a <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> with the following command:<\/p>\n<pre><code class=\"language-bash\"><span class=\"glossaryai-tooltip glossary-term-1168\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-volume-create\/\" target=\"_blank\">docker volume create<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker volume create allows users to create persistent storage that can be shared among containers. It decouples data from the container lifecycle, ensuring data integrity and flexibility.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-volume-create\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> my-volume<\/code><\/pre>\n<h3>Using Volumes<\/h3>\n<p>To use the <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> in a <span class=\"glossaryai-tooltip glossary-term-650\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\" target=\"_blank\">container<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Containers are lightweight, portable units that encapsulate software and its dependencies, enabling consistent execution across different environments. They leverage OS-level virtualization for efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/container\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>, you can specify it at runtime:<\/p>\n<pre><code class=\"language-bash\">docker <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> -d -v my-volume:\/app\/data <\/code><\/pre>\n<h3>Inspecting Volumes<\/h3>\n<p>To view detailed information about a <span class=\"glossaryai-tooltip glossary-term-660\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/volume\/\" target=\"_blank\">volume<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Volume is a quantitative measure of three-dimensional space occupied by an object or substance, typically expressed in cubic units. It is fundamental in fields such as physics, chemistry, and engineering.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/volume\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-bash\"><span class=\"glossaryai-tooltip glossary-term-1169\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-volume-inspect\/\" target=\"_blank\">docker volume inspect<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Volume Inspect is a command used to retrieve detailed information about specific volumes in a Docker environment. It provides metadata such as mount point, driver, and options, aiding in effective volume management.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-volume-inspect\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> my-volume<\/code><\/pre>\n<h2>Docker Compose<\/h2>\n<p><span class=\"glossaryai-tooltip glossary-term-654\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-compose\/\" target=\"_blank\">Docker Compose<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file. It simplifies deployment, configuration, and orchestration of services, enhancing development efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-compose\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> is a tool that allows you to define and manage multi-container Docker applications. With Compose, you can specify the application <span class=\"glossaryai-tooltip glossary-term-682\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/stack\/\" target=\"_blank\">stack<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A stack is a data structure that operates on a Last In, First Out (LIFO) principle, where the most recently added element is the first to be removed. It supports two primary operations: push and pop.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/stack\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> in a <code>docker-compose.yml<\/code> file.<\/p>\n<h3>Sample <code>docker-compose.yml<\/code><\/h3>\n<p>Here\u2019s an example of a simple web application with a web server and a database:<\/p>\n<pre><code class=\"language-yaml\">version: '3'\nservices:\n  web:\n    image: my-web-app\n    build: .\n    ports:\n      - \"5000:5000\"\n    volumes:\n      - .\/app:\/app\n\n  db:\n    <span class=\"glossaryai-tooltip glossary-term-651\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/image\/\" target=\"_blank\">image<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">An image is a visual representation of an object or scene, typically composed of pixels in digital formats. It can convey information, evoke emotions, and facilitate communication across various media.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/image\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>: postgres\n    environment:\n      POSTGRES_USER: user\n      POSTGRES_PASSWORD: password<\/code><\/pre>\n<h3>Running Docker Compose<\/h3>\n<p>To start the application, <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span>:<\/p>\n<pre><code class=\"language-bash\">docker-compose up<\/code><\/pre>\n<p>To stop the application, use:<\/p>\n<pre><code class=\"language-bash\">docker-compose down<\/code><\/pre>\n<h2>Docker Security Best Practices<\/h2>\n<p>While Docker provides isolation for applications, it is crucial to implement security best practices to mitigate potential risks:<\/p>\n<ol>\n<li>\n<p><strong>Use Official Images<\/strong>: Always prefer official images from <span class=\"glossaryai-tooltip glossary-term-653\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-hub\/\" target=\"_blank\">Docker Hub<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">Docker Hub is a cloud-based repository for storing and sharing container images. It facilitates version control, collaborative development, and seamless integration with Docker CLI for efficient container management.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/docker-hub\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> or well-maintained repositories.<\/p>\n<\/li>\n<li>\n<p><strong>Limit Privileges<\/strong>: <span class=\"glossaryai-tooltip glossary-term-672\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\" target=\"_blank\">Run<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">\"RUN\" refers to a command in various programming languages and operating systems to execute a specified program or script. It initiates processes, providing a controlled environment for task execution.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/run\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> containers with the least privileges necessary. Avoid using the root user in containers unless absolutely necessary.<\/p>\n<\/li>\n<li>\n<p><strong>Keep Images Up to Date<\/strong>: Regularly update your images to include security patches and updates.<\/p>\n<\/li>\n<li>\n<p><strong>Scan Images for Vulnerabilities<\/strong>: Use tools like <code>Clair<\/code> or <code>Trivy<\/code> to scan your images for vulnerabilities.<\/p>\n<\/li>\n<li>\n<p><strong>Use Docker Secrets for Sensitive Data<\/strong>: Never hard-code sensitive information in your application code. Use Docker Secrets for managing sensitive data securely.<\/p>\n<\/li>\n<li>\n<p><strong>Implement <span class=\"glossaryai-tooltip glossary-term-661\"><span class=\"glossaryai-link\"><a href=\"https:\/\/dockerpros.com\/es\/wiki\/network\/\" target=\"_blank\">Network<\/a><\/span><span class=\"gai-content-hidden glossaryai-tooltip-content\"><span class=\"gai-tooltip-body\"><span class=\"glossaryai-tooltip-text\">A network, in computing, refers to a collection of interconnected devices that communicate and share resources. It enables data exchange, facilitates collaboration, and enhances operational efficiency.<span class=\"glossaryai-more-link\"> <a href=\"https:\/\/dockerpros.com\/es\/wiki\/network\/\">More \u00bb<\/a><\/span><\/span><\/span><\/span><\/span> Segmentation<\/strong>: Use custom networks to isolate services and control traffic between containers.<\/p>\n<\/li>\n<\/ol>\n<h2>Conclusion<\/h2>\n<p>Docker is an invaluable tool for modern application development and deployment, especially in Linux environments. By mastering the installation, commands, and advanced features of Docker, you can streamline your development workflow and effectively manage your applications. With the best practices and security measures outlined in this guide, you can create robust, scalable, and secure applications using Docker. Embrace the power of containerization and unlock new potential in your development process. Happy containerizing!<\/p>","protected":false},"excerpt":{"rendered":"<p>To use Docker on Linux, first install Docker via your package manager. Then, learn basic commands like `docker run`, `docker build`, and `docker-compose` to manage containers effectively.<\/p>","protected":false},"author":1,"featured_media":278,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-229","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-integrations-and-use-cases"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How do I use Docker on Linux? - Dockerpros<\/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:\/\/dockerpros.com\/es\/integraciones-y-casos-de-uso\/como-uso-docker-en-linux\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How do I use Docker on Linux? - Dockerpros\" \/>\n<meta property=\"og:description\" content=\"To use Docker on Linux, first install Docker via your package manager. Then, learn basic commands like `docker run`, `docker build`, and `docker-compose` to manage containers effectively.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dockerpros.com\/es\/integraciones-y-casos-de-uso\/como-uso-docker-en-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Dockerpros\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-21T11:43:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-docker-on-linux_229.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"dockerpros\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"dockerpros\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/\"},\"author\":{\"name\":\"dockerpros\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4\"},\"headline\":\"How do I use Docker on Linux?\",\"datePublished\":\"2024-07-21T11:43:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/\"},\"wordCount\":913,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/dockerpros.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-docker-on-linux_229.jpg\",\"articleSection\":[\"Integrations and Use Cases\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/\",\"url\":\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/\",\"name\":\"How do I use Docker on Linux? - Dockerpros\",\"isPartOf\":{\"@id\":\"https:\/\/dockerpros.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-docker-on-linux_229.jpg\",\"datePublished\":\"2024-07-21T11:43:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#primaryimage\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-docker-on-linux_229.jpg\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-docker-on-linux_229.jpg\",\"width\":800,\"height\":600,\"caption\":\"how-do-i-use-docker-on-linux-2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dockerpros.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How do I use Docker on Linux?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dockerpros.com\/#website\",\"url\":\"https:\/\/dockerpros.com\/\",\"name\":\"Dockerpros\",\"description\":\"DockerPros \u2013 Your Ultimate Docker Resource Hub\",\"publisher\":{\"@id\":\"https:\/\/dockerpros.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dockerpros.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dockerpros.com\/#organization\",\"name\":\"Dockerpros\",\"url\":\"https:\/\/dockerpros.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png\",\"width\":532,\"height\":114,\"caption\":\"Dockerpros\"},\"image\":{\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4\",\"name\":\"dockerpros\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/dockerpros.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1780577253\",\"contentUrl\":\"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1780577253\",\"caption\":\"dockerpros\"},\"sameAs\":[\"https:\/\/dockerpros.com\/\"],\"url\":\"https:\/\/dockerpros.com\/es\/author\/dockerpros\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How do I use Docker on Linux? - Dockerpros","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:\/\/dockerpros.com\/es\/integraciones-y-casos-de-uso\/como-uso-docker-en-linux\/","og_locale":"es_ES","og_type":"article","og_title":"How do I use Docker on Linux? - Dockerpros","og_description":"To use Docker on Linux, first install Docker via your package manager. Then, learn basic commands like `docker run`, `docker build`, and `docker-compose` to manage containers effectively.","og_url":"https:\/\/dockerpros.com\/es\/integraciones-y-casos-de-uso\/como-uso-docker-en-linux\/","og_site_name":"Dockerpros","article_published_time":"2024-07-21T11:43:54+00:00","og_image":[{"width":800,"height":600,"url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-docker-on-linux_229.jpg","type":"image\/jpeg"}],"author":"dockerpros","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"dockerpros","Tiempo de lectura":"6 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#article","isPartOf":{"@id":"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/"},"author":{"name":"dockerpros","@id":"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4"},"headline":"How do I use Docker on Linux?","datePublished":"2024-07-21T11:43:54+00:00","mainEntityOfPage":{"@id":"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/"},"wordCount":913,"commentCount":0,"publisher":{"@id":"https:\/\/dockerpros.com\/#organization"},"image":{"@id":"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-docker-on-linux_229.jpg","articleSection":["Integrations and Use Cases"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/","url":"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/","name":"How do I use Docker on Linux? - Dockerpros","isPartOf":{"@id":"https:\/\/dockerpros.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#primaryimage"},"image":{"@id":"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-docker-on-linux_229.jpg","datePublished":"2024-07-21T11:43:54+00:00","breadcrumb":{"@id":"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/"]}]},{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#primaryimage","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-docker-on-linux_229.jpg","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/how-do-i-use-docker-on-linux_229.jpg","width":800,"height":600,"caption":"how-do-i-use-docker-on-linux-2"},{"@type":"BreadcrumbList","@id":"https:\/\/dockerpros.com\/integrations-and-use-cases\/how-do-i-use-docker-on-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dockerpros.com\/"},{"@type":"ListItem","position":2,"name":"How do I use Docker on Linux?"}]},{"@type":"WebSite","@id":"https:\/\/dockerpros.com\/#website","url":"https:\/\/dockerpros.com\/","name":"Profesionales de Docker","description":"DockerPros \u2013 Tu centro definitivo de recursos Docker","publisher":{"@id":"https:\/\/dockerpros.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dockerpros.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/dockerpros.com\/#organization","name":"Profesionales de Docker","url":"https:\/\/dockerpros.com\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/","url":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","contentUrl":"https:\/\/dockerpros.com\/wp-content\/uploads\/2024\/07\/Dockerpros_logo_blanco.png","width":532,"height":114,"caption":"Dockerpros"},"image":{"@id":"https:\/\/dockerpros.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/dockerpros.com\/#\/schema\/person\/a9b4c3d7f7a8e2b072e77d47b382a3a4","name":"profesionales de Docker","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/dockerpros.com\/#\/schema\/person\/image\/","url":"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1780577253","contentUrl":"https:\/\/dockerpros.com\/wp-content\/litespeed\/avatar\/d13b9d4f101de1a7535b404e0c59affd.jpg?ver=1780577253","caption":"dockerpros"},"sameAs":["https:\/\/dockerpros.com\/"],"url":"https:\/\/dockerpros.com\/es\/author\/dockerpros\/"}]}},"_links":{"self":[{"href":"https:\/\/dockerpros.com\/es\/wp-json\/wp\/v2\/posts\/229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dockerpros.com\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dockerpros.com\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/es\/wp-json\/wp\/v2\/comments?post=229"}],"version-history":[{"count":0,"href":"https:\/\/dockerpros.com\/es\/wp-json\/wp\/v2\/posts\/229\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dockerpros.com\/es\/wp-json\/wp\/v2\/media\/278"}],"wp:attachment":[{"href":"https:\/\/dockerpros.com\/es\/wp-json\/wp\/v2\/media?parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dockerpros.com\/es\/wp-json\/wp\/v2\/categories?post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dockerpros.com\/es\/wp-json\/wp\/v2\/tags?post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}