In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to use Podman in Fedora", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use Podman in Fedora" this article.
Podman is part of Libpod, and its definition can be simply expressed with this command: alias docker=podman,Libpod is a tool and library for creating container pod, which contains pod management tools Podman,Podman management pod, containers, container images, and container volumes.
Install Podman
The command for Podman is the same as docker. If you have already installed Docker, just type alias docker=podman on the terminal.
In Fedora, Podman is installed by default. But if you don't install it for any reason, you can install it with the following command:
Sudo dnf install podman
For Fedora silverblue users, Podman is already installed in your operating system.
After installation, run the "hello world" image to make sure everything is working:
Podman pull hello-worldpodman run hello-world
If everything works well, you will see the following output on the terminal:
Hello from docking this message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps:1.The Docker client contacted the Docker daemon.2.The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3.The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.4.The Docker daemon streamed that output to the Docker client, which sent it to your terminal.To try something more ambitious, you can run an Ubuntu container with:$ docker run-it ubuntu bashShare images, automate workflows, and more with a free Docker ID: https://hub.docker.com/For more examples and ideas, visit: https://docs.docker.com/get-started/ simple Nodejs applications
First, we will create a folder webapp and enter the following command on the terminal:
Mkdir webapp & & cd webapp
Now create the file package.json, which includes all the dependencies needed for the project to run. Copy the following code in the file package.json:
{"dependencies": {"express": "*"}, "scripts": {"start": "node index.js"}}
Create the file index.js and add the following code to it:
Const express = require ('express') const app = express (); app.get (' /', (req, res) = > {res.send ("Hello World!")}); app.listen (8081, () = > {console.log ("Listing on port 8080");})
You can download the source code here.
Create Dockerfile
First, create a file called Dockerfile and make sure that the first character is uppercase, not lowercase, and then add the following code there:
FROM node:alpineWORKDIR usr/appCOPY. /. / RUN npm installCMD ["npm", "start"]
Make sure you are in the webapp folder, then display the image, and then enter the following command:
Podman build.
Make sure you add... The mirror will be created on your machine, and you can display it with the following command:
Podman images
The final step is to run the image in the container by entering the following command:
Podman run-p 8080 purl 8080
Now open localhost:8080 in your browser and you will see that your application is already working.
Stop and delete containers
Using CTRL-C to exit the container, you can use the container ID to delete the container. Get the ID and use these commands to stop the container:
Podman ps-apodman stop
You can delete the image from your machine using the following command:
Podman rmi above is all the content of the article "how to use Podman in Fedora". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.