RHCSA PODMAN Managing Container

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone welcome to my tutorial about managing containers with podman so today we're going to be focusing on the objectives of the red hat certified system administrator so the first thing we want to do is uh download man okay so first thing we want to do is use sudo yum module install you can also put a dash y in there that way it goes through all the props okay guys i skipped a little bit forward for you guys um so you have to wait um that took about a couple of minutes all right so the next thing you want to do is validate the installation okay so the other thing now that you validated it you want to get it started so you basically you want to check if it's already started already most likely it's not so you can use systemctl podman so it says inactive so now we want to start it okay now we check the status you can see active and it's running so once pod mana is running so the next thing is uh learning about podman search so the important thing for this is that like when you're using this command is definitely going to be helpful especially during the test because they're in the test you might not even remember the whole address for it plus you're not going to have internet access so the great thing is that you can use podband search so if you use that you'll be able to search the actual image or container so you see i type in ub8 which is red hat 8 so these are all the images that they have all right so specifically the one that i need i need to pull will be the registry dot access dot red hat dot com slash ub8 within the colon i'm going to put in for the latest image so right now i'm just basically pulling the image you don't have to pull the image actually because you can start it on demand but it's always good to have it on there if you want to make multiple instances so now if you use the podman images command we will see that from the repository and this is the image id so this we're going to use to start the actual containers let's create it two weeks ago probably update it and 213 megabytes so the next thing we want to do is start it so we can do podman run dash i t so you want to use a terminal and then you can either copy and paste this or type it in and then we're going to put a command we can do so we can put a command in now so we can do like uh ls you see that we're actually in the container right now that's the actual container and if we catch etc host red hat release you're going to see that as a red hat linux release 8.3 now we can exit exit out of it now that we exited it you can actually check you can do the ps a it'll tell you the process it'll tell you that it was created 30 seconds ago and it exited nine seconds ago and actually if you don't name your containers with a dash dash name you're going to see that it names it automatically for you so if we want to stop first if you want to remove the container the first thing you do is stop it so once you stop it then you can remove it so you use rm command to remove it so one is to stop the um pod man our container and then the second one is to remove it and then the last one will be to remove the image so last let's remove the image but to remove the image you actually have to type in the container id so that's removing it and now that we check we don't have any containers there so if we stopped it and removed the container we'll still have the image that we had before as you can see this id and we'll be able to make multiple instances of that actual container all right and then the other command that you guys should learn is definitely scopia so if you're pulling any other let's say images use scorpio inspect so anytime you're inspecting it you use the docker colon and then double slash so you can actually type in the same command we typed in earlier or main address so technically speaking you can always inspect it before you download so this will give you more information about it so the scope you inspect is definitely part of the test so learning how to use scopio okay so now it downloaded so this is all the information about this particular particular container as you can see tells you when it's created it tells you the architecture os and all the other information all right so we're going to clear that now so the next thing is we're going to be learning how to actually make a apache server on demand um basically we're not downloading the image we can just get it straight from the repository so the first i'm going to do is pod man dash d which means it's detached meaning that it's going to be running in the background next thing we're going to use the name command remember if we don't name it the actual service will name it itself so we're going to call it apache um then we're going to get we're going to use a dash p so this is just mapping your port on your local machine to the actual container so we're going to map our port 8000 to 8080 and after that we mapped this we're gonna actually give it uh persistent storage so i haven't made the folder yet but we're gonna make it so the folder we're gonna use is web data which will be in our home folder and then we're gonna map this to var www www.html so um if you guys are not familiar with uh httpd or apache so basically this is the folder that comes by default and this is where your actual like index.html or your home page will be and then this is actually our page right here and this is the delimiter so basically saying that um you're separating it from right here okay so now that we have all these commands here the last command that you want to use actually before that we do that you want to put capital z on here for se linux because if you don't use this correctly basically for the security policy it's not going to allow it to use this location because this location is not related to the apache server or the container so now that we have all these things which is very important to have during the test um is we're going to put in the actual container that we're going to be using so we're going to use the httpd seven so last one thing i did forget you guys is to um type in the run command okay there it is so right now it's downloading it and it's gonna make it instant so this is very important um now that we have it downloaded and stuff we're gonna make this persistent all right so i gotta make that directory that is okay so what i did basically is that it was error because obviously it didn't exist so i reran the command and as you can see this long string of numbers and letters it just means that it was successful okay so i'm in my home folder now as i can see so the next one i got to do is make a folder for my systemd configuration file or service file so i'm going to make it here can i use a dash p command because i'm making subfolders in that folder so now that i have that we got to check our i mean i mean our processes let's see so we can see that it's running we have our apache server running um it shows you the port that we mapped and shows you the name that we named it and the actual like image that is using all right so the next thing we want to do is actually be able to make this uh systemd service so what we're going to do is podman generate system d all right and then we're gonna we're gonna give her the name which is um touchy and then this is very important that you use the files and new when you're making your when you're making your generating your systemd so if you don't have files and new then you're not going to be able to set it up properly but first i'm going to go into my configuration folder because that's where i want to actually save this app okay so i have my container apache.service here so the next thing we want to do is go to systemctl and then anytime you're messing around with the container like with systemctl you always use the dash dash user so we're going to use user and then we're going to use daemon reload so we're going to reload it okay so once that it's reloaded next thing we want to do is um enable linger so this will basically enable the service to run even though the user is locked out so we're going to enable linger which is very important to use especially for a rootless container and then you can use show user it'll tell us that linger was enabled all right so the next thing we want to do is actually enable it now so we're going to do enable now and then we're going to put this name container slash i mean uh dash apache dot service okay awesome so now we have the actual container that it's persistent now so what i'm going to do i'm going to make a file or as you can see that i'm echoing hello into a file called test txt so i'm going to use the curl command all right so this is basically going to tell me if the actual like apache server is working as you can see the website loaded or the default web page that's awesome so that means that it's working now we're going to clear that and then now what we're going to do we're going to go to that uh test.txt because remember we mapped our web data home on the web data folder in our home home folder with the actual folder and var slash www.html so as you can see it says hello so meaning that we're able to actually access our home folder which means that is persistent storage so yeah so that's pretty much it um in a nutshell we went over the pulling the images stopping the images removing the images using scopio to inspect we also went through uh downloading obviously using container tools because it's a module it's not a daemon it's a module so always remember that i'm using the podman search function so with the search you can actually search images so if you ever get lost you can literally type whatever image you're looking for in the test and be able to download it and then the next thing is we know the dash dash name command because um you have to use a dash dash name um that way you can name your container instead of it being named dynamically and then the last one was making the system deconfiguration file so the most important thing is to use the dash dash file and the dash dash new especially when you're making it and then when you when you are making um the file to be persistent storage remember you have to use the colon-z at the end of it because of sc linux so that's pretty much it um and if you guys like this contact please uh subscribe and if you guys have any questions or i want to leave any comments uh please feel free free to do so um thank you guys and um enjoy the rest of your day
Info
Channel: Mystery Linux
Views: 1,344
Rating: undefined out of 5
Keywords: red hat enterprise linux, rhel 8, red hat certified system administrator, Linux, containers, podman, rhcsa podman, rhsca containers, linux containers, linux podman, redhat system admin, rhcsa ex 200, redhat 8, containers explained, red hat podman, red hat system admin containers
Id: HAnmR7voKK4
Channel Id: undefined
Length: 14min 59sec (899 seconds)
Published: Tue Mar 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.