podman-desktop/docs/getting-started/getting-started.html
github-actions[bot] 579a3d1cbe deploy: c94ef04b01
2022-10-24 12:34:54 +00:00

16 lines
No EOL
22 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en" dir="ltr" class="docs-wrapper docs-doc-page docs-version-current plugin-docs plugin-id-default docs-doc-id-getting-started/getting-started">
<head>
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v2.1.0">
<title data-rh="true">Getting Started with Podman Desktop | Podman Desktop</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://podman-desktop.io/docs/getting-started/getting-started"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Getting Started with Podman Desktop | Podman Desktop"><meta data-rh="true" name="description" content="This blog will help you build and run your first container image on Podman Desktop"><meta data-rh="true" property="og:description" content="This blog will help you build and run your first container image on Podman Desktop"><meta data-rh="true" name="keywords" content="podman desktop,podman,containers"><link data-rh="true" rel="icon" href="/img/favicon.ico"><link data-rh="true" rel="canonical" href="https://podman-desktop.io/docs/getting-started/getting-started"><link data-rh="true" rel="alternate" href="https://podman-desktop.io/docs/getting-started/getting-started" hreflang="en"><link data-rh="true" rel="alternate" href="https://podman-desktop.io/docs/getting-started/getting-started" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://MR01ANKQ9S-dsn.algolia.net" crossorigin="anonymous"><link rel="search" type="application/opensearchdescription+xml" title="Podman Desktop" href="/opensearch.xml"><link rel="stylesheet" href="/assets/css/styles.24e64ee2.css">
<link rel="preload" href="/assets/js/runtime~main.5356607a.js" as="script">
<link rel="preload" href="/assets/js/main.04075ada.js" as="script">
</head>
<body class="navigation-with-keyboard">
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"dark")}()</script><div id="__docusaurus">
<div role="region" aria-label="theme.common.skipToMainContent"><a href="#" class="skipToContent_oPtH">Skip to main content</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Navigation bar toggle" class="navbar__toggle clean-btn" type="button" tabindex="0"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/logo.svg" alt="Podman Desktop Logo" class="themedImage_BQGR themedImage--light_HAxW"><img src="/img/logo.svg" alt="Podman Desktop Logo" class="themedImage_BQGR themedImage--dark_bGx0"></div><b class="navbar__title text--truncate">Podman Desktop</b></a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/docs/intro">Documentation</a><a class="navbar__item navbar__link" href="/core-values">Core Values</a><a class="navbar__item navbar__link" href="/features">Features</a><a class="navbar__item navbar__link" href="/downloads">Downloads</a><a class="navbar__item navbar__link" href="/extend">Extend</a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/containers/podman-desktop" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-github-link"></a><div class="toggle_ki11 colorModeToggle_Hewu"><button class="clean-btn toggleButton_MMFG toggleButtonDisabled_Uw7m" type="button" disabled="" title="Switch between dark and light mode (currently dark mode)" aria-label="Switch between dark and light mode (currently dark mode)"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_lgto"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_U96C"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="searchBox_WqAV"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div class="main-wrapper mainWrapper_MB5r docsWrapper_ct1J"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_iEvu" type="button"></button><div class="docPage_KLoz"><aside class="theme-doc-sidebar-container docSidebarContainer_y0RQ"><div class="sidebar_CUen"><nav class="menu thin-scrollbar menu_jmj1"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/intro">Introduction</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" aria-expanded="false" href="/docs/Installation/macos-install">Installation</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" aria-expanded="true" href="/docs/getting-started/getting-started">Getting Started</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-2 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/getting-started/getting-started">Getting Started with Podman Desktop</a></li></ul></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/troubleshooting">Troubleshooting</a></li></ul></nav></div></aside><main class="docMainContainer_sTIZ"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_Qr34"><div class="docItemContainer_tjFy"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_T5ub" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_GlTw"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">Getting Started</span><meta itemprop="position" content="1"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Getting Started with Podman Desktop</span><meta itemprop="position" content="2"></li></ul></nav><div class="tocCollapsible_wXna theme-doc-toc-mobile tocMobile_Ojys"><button type="button" class="clean-btn tocCollapsibleButton_iI2p">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Getting Started with Podman Desktop</h1></header><h2 class="anchor anchorWithStickyNavbar_JmGV" id="introduction">Introduction<a class="hash-link" href="#introduction" title="Direct link to heading"></a></h2><p>Podman Desktop leverages <a href="https://podman.io/" target="_blank" rel="noopener noreferrer">Podman Engine</a> to provide a lightweight and daemon-less container management tool. It enables you to easily work with containers from your local environment without running container management commands. </p><p>Podman Desktop brings all the capabilities of Podman with the added advantage of a GUI which is becoming increasingly powerful and user-friendly. It is super easy to adapt to. With this tutorial, you will be ready to roll and work with your containerized applications in no time.</p><p>In this tutorial, I am working with Podman Desktop v0.0.5.</p><h2 class="anchor anchorWithStickyNavbar_JmGV" id="requirements">Requirements<a class="hash-link" href="#requirements" title="Direct link to heading"></a></h2><p>In order to work with Podman Desktop, you firstly require the latest version of Podman Desktop. Depending on your Operating System, you can download it from <a href="https://podman-desktop.io/downloads" target="_blank" rel="noopener noreferrer">this</a> page.</p><p>Next, you need the latest version of Podman Engine installed on your computer. When started, Podman Desktop looks for the Podman Engine in the system and will prompt you to install the same if it is not present. You can read more about how to set up the Podman Desktop and Podman Engine in the Installation guide <a href="/docs/installation/macos-install">here</a>.</p><p>Once everything is set up, you are ready to go!</p><h2 class="anchor anchorWithStickyNavbar_JmGV" id="get-started">Get Started<a class="hash-link" href="#get-started" title="Direct link to heading"></a></h2><p>When you open the Podman Desktop application, you will be greeted with the home screen. It will show you a toggle button that says Initialize Podman. And as mentioned, it initializes the Podman Engine and creates a Podman Machine for you. Click on it to create a Podman Machine. Within no time, your Podman Machine will be created. This is equivalent to running the command <code>podman machine init</code>. You can read more about it <a href="https://docs.podman.io/en/latest/markdown/podman-machine-init.1.html" target="_blank" rel="noopener noreferrer">here</a>.</p><p>Next, you need to start the Podman Machine by toggling the button that says Run Podman. This is equivalent to running <code>podman machine start</code>. You can read more about it <a href="https://docs.podman.io/en/latest/markdown/podman-machine-start.1.html" target="_blank" rel="noopener noreferrer">here</a>. </p><p>Once it says “Podman is running”, you are ready to build images and run containers! </p><p>Our first step will be to build an image for our application followed by running the image to create the container.</p><h3 class="anchor anchorWithStickyNavbar_JmGV" id="1-build-image">1. Build Image<a class="hash-link" href="#1-build-image" title="Direct link to heading"></a></h3><p>For this section of the tutorial, I have created my Containerfile using the Red Hat Universal Base Image. You can also write your own Containerfiles and build images from it using the Red Hat Universal Base Image (UBI). Read more about it in <a href="https://developers.redhat.com/articles/2021/11/30/build-lightweight-and-secure-container-images-using-rhel-ubi" target="_blank" rel="noopener noreferrer">this blog</a>. Once you have your Containerfile ready, follow the steps below to build your own image.</p><p>1) In order to load the Containerfile to Podman Desktop and build the Image, we browse to the “Images” section and click on the “Build Image” button. This opens a tab within which you can select the path where your Containerfile is present.</p><p><img loading="lazy" alt="img1.1" src="/assets/images/1.1-1291877ef9f406d5a1f3460d6dcc052d.png" width="2880" height="1622" class="img_SS3x"></p><p>2) Click on the placeholder “Select Containerfile to build”, browse to the folder where the Containerfile is present and select the file.</p><p><img loading="lazy" alt="img1.2" src="/assets/images/1.2-fd99b4500fc20fee706c84f4e59c3ff3.png" width="2880" height="1622" class="img_SS3x"></p><p>3) Go ahead and type in any name for your image below but Podman Desktop will have something generated by default in case you want to skip it. </p><p><img loading="lazy" alt="img1.3" src="/assets/images/1.3-e8371a7b76d99545af069f5a613cddf3.png" width="2880" height="1622" class="img_SS3x"></p><p>4) Click on Build and thats it. You will see each instruction from your Containerfile being executed in order to build the image. </p><p><img loading="lazy" alt="img1.4" src="/assets/images/1.4-600f8ae46e4e7a8d1eca0733071fa10c.png" width="2880" height="1622" class="img_SS3x"></p><p>5) Once completed, Click on “Done” above to continue. You will see that your image has been added to the Images section of Podman Desktop. </p><p><img loading="lazy" alt="img1.5" src="/assets/images/1.5-50d521ca688a8b3b16bf07609e1f15d2.png" width="2880" height="1622" class="img_SS3x"></p><h3 class="anchor anchorWithStickyNavbar_JmGV" id="2-create-and-run-the-container">2. Create and Run the Container<a class="hash-link" href="#2-create-and-run-the-container" title="Direct link to heading"></a></h3><p>Following are the steps to create and start a container from the image.</p><p>1) Once the image is built, you can see its name (in our case, my-custom-image) and other details in the Images section. </p><p><img loading="lazy" alt="img2.1" src="/assets/images/2.1-27a75e134f0eb038fb6dab73436810e8.png" width="2880" height="1054" class="img_SS3x"></p><p>2) Simply hover over the name of the image and you will see a list of buttons to the right. In case you are confused about the action of each button, just take the cursor over each button and wait for it to tell the action it does. </p><p><img loading="lazy" alt="img2.2" src="/assets/images/2.2-90e9f1607af0147ab9d3653b29c009de.png" width="2880" height="1054" class="img_SS3x"></p><p>3) Upon clicking the Run Image button, a window will appear and it will ask you to Create the container by giving it a name and mapping the desired port number. </p><p><img loading="lazy" alt="img2.3" src="/assets/images/2.3-a548da08a4ffcd6952e4c6e3c9e878f1.png" width="2880" height="1368" class="img_SS3x"></p><p>4) Once you click on “Start Container”, you will see some changes in the Containers section. Upon hovering your cursor over the newly created container, you will see a set of buttons allowing you to work with it.</p><p><img loading="lazy" alt="img2.4" src="/assets/images/2.4-afc5ce034b3ee53eee232550195df7ce.png" width="2880" height="1368" class="img_SS3x"></p><p>5) To check if it is running our application as desired, I will open the URL in the browser (in this case, localhost:8080 because thats where we mapped our port). This can be done by clicking on the Open Browser button.</p><p><img loading="lazy" alt="img2.5" src="/assets/images/2.5-a912781cf72b27268f86fd39926f9815.png" width="2880" height="1368" class="img_SS3x"></p><p>6) As we can see, it returns {“Hello”:”World”} as intended. </p><p><img loading="lazy" alt="img2.6" src="/assets/images/2.6-b40e26cb8b4ad0a1f6ce8e47afd2dd67.png" width="2880" height="1368" class="img_SS3x"></p><h2 class="anchor anchorWithStickyNavbar_JmGV" id="conclusion">Conclusion<a class="hash-link" href="#conclusion" title="Direct link to heading"></a></h2><p>So thats it! It is that simple to get started with Podman Desktop for building and running your first container image!</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="theme-doc-footer-tags-row row margin-bottom--sm"><div class="col"><b>Tags:</b><ul class="tags_Ow0B padding--none margin-left--sm"><li class="tag_DFxh"><a class="tag_otG2 tagRegular_s0E1" href="/docs/tags/podman-desktop">podman-desktop</a></li><li class="tag_DFxh"><a class="tag_otG2 tagRegular_s0E1" href="/docs/tags/getting-started">getting-started</a></li></ul></div></div><div class="theme-doc-footer-edit-meta-row row"><div class="col"><a href="https://github.com/containers/podman-desktop/tree/main/website/docs/getting-started/2022-08-05-getting-started.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_bHB7" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_pbO5"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages navigation"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/Installation/linux-install"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Linux</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/troubleshooting"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Troubleshooting</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_XG6w thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#introduction" class="table-of-contents__link toc-highlight">Introduction</a></li><li><a href="#requirements" class="table-of-contents__link toc-highlight">Requirements</a></li><li><a href="#get-started" class="table-of-contents__link toc-highlight">Get Started</a><ul><li><a href="#1-build-image" class="table-of-contents__link toc-highlight">1. Build Image</a></li><li><a href="#2-create-and-run-the-container" class="table-of-contents__link toc-highlight">2. Create and Run the Container</a></li></ul></li><li><a href="#conclusion" class="table-of-contents__link toc-highlight">Conclusion</a></li></ul></div></div></div></div></main></div></div><footer class="footer"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Documentation</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/docs/intro">Introduction</a></li><li class="footer__item"><a class="footer__link-item" href="/docs/troubleshooting">Troubleshooting</a></li></ul></div><div class="col footer__col"><div class="footer__title">Links</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/containers/podman-desktop" target="_blank" rel="noopener noreferrer" class="footer__link-item">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPrP"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://discordapp.com/invite/TCTB38RWpf" target="_blank" rel="noopener noreferrer" class="footer__link-item">Chat with us<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPrP"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a href="https://github.com/containers/podman-desktop/projects?type=beta" target="_blank" rel="noopener noreferrer" class="footer__link-item">Podman Desktop Planning &amp; Roadmap<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPrP"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2022 Podman Desktop<br>Apache License 2.0 License</div></div></div></footer></div>
<script src="/assets/js/runtime~main.5356607a.js"></script>
<script src="/assets/js/main.04075ada.js"></script>
</body>
</html>