 Hello, yeah, I think it's time, hello everyone, yeah, I'm Trishna, I am intern at Red Hat with federal engineering team, so before I start, this is my first DevCon and I'm first in Bruno and first conference talk, yeah, so yeah, thank you. So as the name implies, I'm going to talk about building and building Docker image and running Docker container for your application on remote atomic host with Ansible. You might be thinking why Ansible? So here is the answer, yeah, automate all things, yeah. So in the course of my job, I used, I generally work with Docker images and Docker containers all the time. So I just thought to find a way why don't I automate these things with Ansible. So I choose Ansible, yeah, so the contents of my talk will have project atomic, building Docker image and container, Ansible automation and cockpit remote manager. So I will give a short introduction on each of the contents first and then I will start the demonstration. Project atomic is a lightweight container based OS which lets you run only containers. So if you're looking for something where you want to run only containers or cluster of containers for your application, then I think project atomic, it's a better place to switch to and it has minimum packages installed. So you don't have to care about packages installed on OS if you're using running containers. Also it uses RPM OS tree tools. So it never leaves your system, remains halfway upgraded, either it happens full or it happens not at all. So with the single command atomic host update, you can upgrade to your OS to the next version and using atomic host rollback, you can just rollback to your previous version, yeah. So there is nothing halfway. That's about project atomic and to your Docker, I think I don't have to talk anything about Docker in 2017, but I'd like to give a short introduction anyway. So Docker wraps your application in a container that it needs to run. So it keeps your containers isolated from each other and from underlying infrastructure. And of course, portability is the biggest key feature of Docker and there are so many things on, yeah, Ansible. So if you're looking for managing remote hosts, automate your daily job and repetitive task, then Ansible is a good tool, really good tool because I just don't want to repeat my task all day. So I'd probably sleep my day, sleep and use Ansible rather, yeah. There is cockpit. Cockpit is a great tool to manage your remote servers, remote host using web user interface. So what cockpit does, you can, you can, you can control, administrate your Linux or GNU servers using web browser. You can start your containers using the only the web browser and any system CTL or any services. You can have access to the terminal of your host running, host using cockpit. So it's, it's super useful tool. Okay. Now we can move to the demonstration, yeah. So is it visible? So here is the root directory, a flask hello world and right there, there is a sub directories Ansible. Ansible is the sub directory, under there we have Ansible configuration file, inventory file and the playbook. And in the same directory we have Docker file and there after we have the application. It's a simple hello world application of flask and this is the hello world Python file which is rendering to index page on root URL request. And there are, I have used change that template for HTML, which is displaying hello world and some magic of CSS, which I probably copy. And I have the Docker file. Is it visible or should I use the terminal? Visible? Okay. So I'm using Fedora as base image and inside there I'm installing Python flask and Python change that template. Then making, I'm making a directory app and copying the source to the app. So here is a source directory where I will put my application on the atomic host. So this is a source directory copied to the app directory inside the container. Then I'm changing my directory and running the file with entry point Python, yeah. Now moving to the Ansible configuration, yeah, I'm SSH-ing to the atomic host as Fedora because I'm using Fedora atomic host and then becoming root user. And inside the inventory file I have the IP of atomic host and we have the SSH private key file. So I'm basically doing everything from my Fedora workstation remotely via Ansible. So here is the playbook. I have two variables, SRCDIR, which has the source path to my application of my workstation. And I have a destination directory where I'm going to put my application on that atomic host. So here is some example where I have done. And here are the plays. First I have created the destination directory and then I'm copying the Docker file from my source directory to the destination directory of atomic host. And then copying the application from my source directory of my workstation to the destination directory of the, under the sub directory source on the atomic host, yeah. Now I'm building, running the build for Docker for image, yeah. So I have used the option hyphenf. So hyphenf you can use to mention where your Docker file is or you can use hyphen file instead. I'm running the Docker container, which is going to be on port 5000 on my atomic host. And then starting the cockpit service with atomic run cockpit image, yeah. So with atomic run, we can run Docker. It will start container of cockpit, the atomic run command. What I have after, yeah. So after that, you have to make sure you're present in the Ansible directory. Then you can simply run Ansible playbook, main.yml that we have created, the playbook. And it is going to do all your tasks. So right after there, after it does all the tasks, you can simply go log into your cockpit and see what is there going on. So cockpit you can, you'll be, once the cockpit starts running on your atomic host, you'll be able to access the cockpit from your web browser with the IP of atomic host on port 1990. So the username will be the username of your atomic host and the password you use. If you don't want to enable password full SSH access, probably you have to turn it on for once. And once you create the password and username, you can disable the password full SSH access right up in there. I have the cockpit running, so I can show you, yeah. This is how it looks like. Is it visible or should I zoom in? Okay, yeah. So here are the containers. You can see what are the containers running on my host. I hope the internet should work. Yeah, so here is the application that is running and the cockpit container itself. Yeah, and here are the play buttons. You can simply play it and the container will start running from the images. So let's test. So here from tools, there is terminal. So from here, I can directly get access to my terminal of atomic host. I'll test the application. Sorry, yeah, yeah, it's there. So yeah, that's it. Yeah, that's what about my talkies. Here is the playbooks you can find on GitHub in my namespace and then Fedora Cloud Ansible. And here there are a few blog posts on this in the project atomic blog and Fedora magazine, you can just read it on your free time. That's it about my talk. Do you have questions? I think I finished it pretty early. Sorry, I didn't get it. So using cockpit, so the question I should repeat, yeah. How should the cockpit have access to your host, right? Yeah, in Ansible, I have turned my user to root, yeah. So after it becomes root, it can run atomic run cockpit. It will start the container. And after the cockpit container starts, you will probably have access to the web user interface of cockpit via your web browser from your current host, yeah. You don't have to manually SSH to your atomic host at all, yeah, yeah, yeah, yeah. So atomic run is kind of replacement of Docker run because when you do Docker run, you have to probably pass lots of options there. So atomic run is kind of wrapper of that. Any more questions? I don't think so. Okay, thank you. 15 minutes or so, so I can just put it on YouTube. Put it on this place open. Yeah. Okay, so. Yeah, now. Yeah, we can think about the atomic run. Think about the atomic run. Anyway, you know, so. So, then they used to do a certain picture on it. Oh, this is what it looks like. Yeah, it looks like. Yeah, it looks good. Yeah, it looks good. I do have a total of two things. I appreciate it. And picture it on the ice right at the bottom, yeah. You have to, we used to, like that, Oh, here. There don't have an inkling about it. This doesn't show them to. It just shows it. Why is there a need for them for these three elevators? For example, if I am in May, the next one I will publish. The question is for, it takes longer to determine the issues. Is it because of the, is it about their own opinion? Is it because of the, is it about their own opinion? Is it because of the, is it about their own opinion? Is there a need for them for these three elevators? He's up there actually. He's the guy. Yeah, I'm just reporting. It doesn't matter. When it's not necessarily going to take on a man, it's, yeah. Yeah, it's just that, it's just that, um, they don't take me back here. They're streaming on the bot. The bot. They use the system. We don't hear from people here. Yeah, so, I'm not sure about the follow-up though. Is there a need for them for these three elevators? Yes. Okay. Okay. They need any assistance? Um. Okay.