 Everyone will come on Saturday morning sessions. This is a workshop session, docker for J2E developers. First of all, a few organizational things. This room has no additional audio, so speakers have to be loud and they will try to do their best, but please be quiet, respect the speakers, and if you need to leave, try to not make noise with the doors. So there will be no break in this session, so if you want to move some tall in a half of this workshop, again be quiet and check the blocks here for the right time. A few more generic things. We really want your feedback, so please give us feedback about Dekom generally and this workshop. You can see some links to Twitter and to the feedback form on the backside of your leaflets, of your programs. And one more thing, there will be lightning sessions and you can vote for your favorite one. The list of the lightning session proposals is just before the D1.5 room, so just go to the D building after the workshop, of course, and vote for your most favorite session. For this workshop, there are some materials on the USB. We have only limited set and they are supposed to be for all the workshops, so you can take them and give us back the USB page. So that's everything from the organization stuff. So I would like to introduce Raphael Pejavides, George Gastaldi, they are both software engineers in J-BOSS projects. George is the project lead of J-BOSS sports and Raphael... Actually, J-BOSS developer materials lead. Okay, docker master. So, guys, it's all yours. Thank you. Okay, so thank you for coming. Today we will introduce you to the world of docker for Java developers. Who develops in Java? Cool, that's cool. Have you guys used docker before? Okay, cool. So, Raphael, we will start by giving the agenda. The agenda? Okay, so this is what we will see. Probably people who have worked with docker before should already be prepared to be facing that the docker base because it will be something that they had contact before. But this is what we will see. We will make an introduction of docker. Then we will see how to create an image and how to deploy Java applications to existing containers. And finally, we will see how to mix, how to run separated containers using docker compose. And finally, we will have five minutes for questions and answers. This material is available under this URL. You can access it on your machine. And once you access this URL, you will arrive on this page. It's exclusively prepared material for the DevConf. And this whole material would take approximately three hours to complete all of them because it involves downloading the docker image, it involves setting up your whole machine. So, since we just have one hour and a half, and also, of course, that would be, these three hours would increase a lot if we download the image using Wi-Fi, using the conference network. So, what I propose to you is that I will show you, I will run the lab in my computer. And then, in your home, you can access your URL and do it yourself. If you have any questions, any doubt, you can send me an email, send me a Twitter. This, this, that handle is my Twitter account. This is the George Gustavs Twitter handle. So, I would be very pleased to answer any questions that you have, that you have. Okay, so why I'm showing this Twitter IP here? It's mostly because the, I'm running a registry here in my machine. So, if we use docker, we need to download the docker image instead of downloading from the Internet because of the Wi-Fi connection, we could download from a machine, okay, to speed up the process. But as I told you, we will not use this approach, okay? So, first of all, this lab shows how to set up your environment. Of course, the first thing that you need is to install docker. Actually, people who are running Linux, Windows and Mac, docker provides a, provides a tool called docker2box. Docker2box comes with the docker, will come with a virtual box, will come with docker machine and docker compose. Why is that? Who is running Linux here? Okay, and who is running Windows? And who is running Mac? Nobody? Okay, essentially docker is a Linux technology. So, it will run actively in Linux. So, for people that use Mac as me, people who use Windows, to be able to run Linux containers, you will need to have a virtual box running the dockerdemon. So, what docker2box does is to install the virtual box for you to create a demon running on your virtual machine. And that's how docker makes possible to run Linux container inside virtual box. Okay, of course, you will need other tools like Java, the web browser, the Git client, and Maven. For people running, for people that use Linux, the virtual box is suggested just in case if you want to run a cluster of docker containers. So, you can simulate that you have many hosts, of course, using virtual box. But for Linux, it's not necessary. Okay? And finally, we have the instructions for Linux users how to get the docker machine. And what docker machine does is to be able to create these virtual box demos. I will show you, this is just a step up, but showing what you need to do to run docker. Finally, the docker client and we are ready to go. So, let me give you an overview of how docker works. Docker is mostly composed of two parts, a client and a server. In a Linux, everything will be at the same machine. So, for example, when you run a docker command, the base command is docker run in the name of the image, this command will send to the docker host where it's running the demo and ask it to create a container based on the image name that you gave here. So, for example, suppose that you ask docker run image Fedora. The docker demo will communicate to the docker hood where we can think that it's like a maven central for people who are Gavi developers. We will get the image, download the image to an internal repo story and we will create a container using that image. So, for people who are not using Linux, these docker hosts is what will run inside the virtual box. Just virtual box? No. With docker machine, which is to use to create docker hosts, I can create a docker host in the cloud. For example, I can create a docker host inside Amazon, inside Microsoft Azure. I can create a docker host in other hosts in a server running inside my network. So, this is the base architecture of docker. So, suppose that in an empty machine that I'm just about to start using docker. With the docker machine, as I said, I can create the docker host. What I need to do... By the way, let me increase the font size here. Is it visible for everybody? So, I have here the docker machine and I want to create an environment for me to work. So, basically, I need to specify a driver. As I said, I have drivers for virtual box, I have drivers for Amazon, I have drivers for Azure. So, I want to create a docker host in my virtual box. Wait, let's find it. Comment, create, virtual box. And I'll give it a name, for example, LED. When I do that, remember, this is just for people that are not using Linux. It will download a boot docker, which is a Linux image. And... The content of the docker is from the free API. Well, the content of the... There is an OVA file with... Yeah, I have another one. Yeah. The content of my view is not the same as the previous show. Yeah, yesterday we had some troubles with the USB drives. So, if you're already broken, please take another one. Sorry for that. If you don't see all the files there... That seems completely different. Yeah. You see just... Yeah. Okay, so, when you run this command, docker machine creates virtual box, it will download a Linux image and create a virtual machine for you running around the docker demo. Okay? I'm canceling it, because I have a docker machine created in here. With a docker machine, you can also list the existing machines. So, if I do a docker machine LS, here you will see I have a depth default and I have a structure machine where I have already my image already downloaded. And how can I say to the docker clients which host should I use? Well, docker machine makes that easy for me. Using the docker machine and command. So, for example, I will use here a structure machine and it will return for me the existing... the environment variables to connect to that specific machine. So, for example, docker machine and structure machine, I should create an environment variable using docker host and the path for the certificate because the docker machine has... the docker host needs a digital certificate from the clients to be able to make the communication. This is necessary to avoid security issues. So, just the clients that have the certificate will be able to communicate with the demo. So, the docker machine automates this process. So, to set this environment variable, docker machine says to me, run this command to configure your shell. So, when I execute that, this will create the environment variables for me to connect on the structure machine, which is a machine that I have previously created with the docker machine create command. And now I can do any docker commands. So, let me kill my existing... just dropping my existing containers so we can start with empty containers. Okay? So, the lab will instruct you to create a machine, get an IP. By the way, the docker machine also allows you to get the IP of the docker demo. So, for example, the structure machine, it will give you the IP. And it's extremely suggested that you use this IP address in your host file. So, you can create here an entry with that IP pointing to the docker host. So, every time that you need to communicate with the demo, you can use the docker host, for example, just to make it more easy for you to work. Okay? But now it starts to play with docker. So, as I said, docker uses images just like a virtual machine to create containers. I have already downloaded a lot of images here so we can start playing. And what you will do to run, for example, Wallfly, you can previously pull the image from the repository using docker-pull-jboss-wallfly which is the docker-pull-jboss. The jboss here, in this case, is the name of the user inside docker-hub and the name of the image because inside jboss we have images for Wallfly, for Wallfly's forum, for every other jboss and jboss projects. So, jboss-pull-wallfly. If I don't specify the tag, it will use the full tag called latest, which is the latest image available for that version. So, let's see what's happening here. Now you can see pulling repository, docker-io, remember that I said that docker-io is just like the Maven central repository. It's where all docker images are stored. It seems that they don't have any issues with the internet. Maven, let me see here. Maybe I was disconnected. I'm stopping the structor machine because I just plugged the cable instead of the Wi-Fi and it changed my network and this machine here needs to update the IP and the DNS. So, that's why I need to stop and start the structor machine again. So, as you can see here, the machine can have a new IP address, so it suggests me to run the docker machine and command to get the new IP in the environment variable. I didn't change it. So, docker pull JbossWallfly and now this command, remember, this is the client. It sends this full command to the demand that's running inside my virtual box. So, as a client, it does nothing. It's just a dumb image. It does not have any intelligence. Everything is made by the demon that's running inside the docker demon. So, as you can see here, it's saying that it's pulling a file system layer. Why does this image have a lot of layers? Because this is something that made docker so popular. I will show you here the contents of the Wallfly image. The Wallfly image is layered because it has a Wallfly that was built in top of an image called JbossBaseJDK, which contains just the JDK, which was built on top of another image that has the CentOS Linux that was built in on top of the image that has the boot file system and the kernel. We can see that taking a look on the source code of this image. So, for example, if I open that JbossWallfly inside, we will see that the docker file that creates that image will see how to create this docker file. And we can see here that this Wallfly image, the base layer of it is an image called baseJDK. If we open the baseJDK, this has the front JbossBase. If we open the JbossBase, we will see here the CentOS installation. Each one of these images have a specialized purpose. So, the Wallfly has just the Wallfly installation. As you can see here, there is no need to install the JDK because the JDK is already installed on this baseJDK image. Let's open it again. The baseJDK image has only the installation of the JDK and the base image just added a user called Jboss and doesn't need to worry about the CentOS installation, which was made in another image. So, that's why you see a lot of file system layers being downloaded. So, how do we run this image now that we have this image locally? We can run Docker image to see the list of all images. What I need to do is specify the run command. So, this is the very base of Docker. Docker run the name of the image, Jboss Wallfly. But, there are some flags that it's important to specify. There is the flag minus I dash I, which will instruct to run this container in interactive mode, which means that I can interact with this container. And, I need also to specify a terminal. So, when I do Docker run minus IT and the image, it will create a container with that Wallfly 10 being executed. Now, a question. Where is this container running? Is it running on my native laptop? Or is it running inside my Docker host where it's running the Docker demo? Who can answer that? Who answer? Yeah! Exactly! Inside the Docker host. That's why people like baseball. Yeah. Okay. Okay. So, this is the very base to execute a Wallfly in your using Docker. If you have a new machine you didn't need to install JDK, you didn't need to create a J-Pause, you didn't need to download the Wallfly, it's just there in the image. Okay. And now, you will stop the container because I run it using interactive mode, so it accepts commands from my terminal. Now, we don't need as... we don't want to run this Wallfly in interactive mode most of the time because anybody can go here and view the process with control C. We want to run that in background. In Docker, this is called Detached Mode where I'm detecting the container from my terminal. So, instead of using the minus it I will use minus b which is Detached. And it's a good practice to give the container a name. So, I can specify here name my Wallfly using the minus minus name. So, Docker run in this mode giving the name my Wallfly for this image. So, now I'm not seeing the container being executed because it's Detached. I can do a Docker PS, just like you do a PS in Linux. And you will see here some information. You'll see the container ID 92BC and the same ID that it returned when you did when you did a Docker run minus d it returned an ID created for that container you can see the ID here the image, the Wallfly the command that's running inside that image and what else they start it was created 15 minutes ago it's up 30 minutes there is a port opened and a name my Wallfly that I created. What happens if I don't specify the minus minus name for example here I didn't specify yeah, it will generate a random name and it's a very funny name each time. Backstablish home every kind of crazy names will be created here. So why this name is so important because if I need to interact with this container which is detected for example I want to see the logs of this container. I can do Docker logs, my Wallfly now I can see the logs running Docker logs minus f and it will keep tailing the logs and I also can use to stop the container so Docker stop I have that other name that was created for me or I can stop my Wallfly what happens if I stop the container well as the name says it stopped and if I do a Docker PS it's not there anymore so what will happen if I try to run this command again using the same name it will say for me that this name already exists it's a conflict the name I will apply already exists so that's an important concept if I do a Docker PS I can't see it because it's not active but it's still there if I do a Docker PS minus a which means all I can see the previously created containers so they where is it let me see my Wallfly is here it was created three minutes ago ok so if you want to hit start this container you can do a Docker start my Wallfly and it will execute it again and if I do a Docker PS it's there it was created three minutes ago but it's just after 12 seconds or if it was stopped I can remove that container using Docker and ok so now let's have access to that container ok so let me start here Detached mode name my Wallfly and the boss Wallfly if I do a Docker PS there is important information for me it says here that 888 which is the default part of Wallfly being it's there as port if I do a Docker logs my Wallfly I can see also here that undertone 8TP is listening on part 880 so what can I do to access this Docker this Wallfly will I use localhost 888 no because it's running where? inside the virtual box in my case for people who are running Docker demo on Linux you can access it on localhost so remember that I said that's a good practice to get the Docker machine IP and place it inside your host file so you can do a Docker host at resolution this will make easy for me to just say Docker host 888 so another scarf for who answer me it doesn't valid for you because you will know you will have already used a Docker before will I be able to just hit enter and access Wallfly yes or no well this was a tricky question why I cannot access it because Docker secures the container for me it if I go to the let's do a research here let's open Docker hub look for that image the open here the the image I can export the Docker file which was used to create the the image I can see here that there is instruction expose 888 but when I do a Docker PS I can see the port 888 here I can ask for Docker to expose that port for the world so how do I do that Docker stop my Wallfly what I will do is when I'm running the container my Wallfly I need to specify with capital P that I need to I want to get all ports that's declared on the file and expose it for me when I do a minus P capital let's see by the way I am the Wallfly now if I do a Docker PS I will see a mapping between my local host and the container but it generated me a random port number 7668 so let's try to see if I can access 32768 now I have access to Wallfly ok but you may look like that and see this is strange I didn't like that because I'm used to have Wallfly running on 8080 I don't like that number the first thing is that why it creates random port numbers because as a container I can create many containers as I want for example suppose that I don't give it a name I can execute this command many times each container will execute on different port without collisions ok that's why Docker it was on random port sorry it will work if you don't use Docker machine do you mean executing natively on Linux? yeah it will work in the same way the only difference between using Docker machine and not using Docker machine is that instead of specifying here Docker host because I'm getting the IP of the virtual machine you can use local host here it's the only difference the port will be the one that is exposed to the Docker file yeah it will get the information from the Docker file from the expose and with the capital P I will it will create random ports to access access it was I ok so let's kill all these containers sorry on the container yes what does that mean there are four containers there are four containers because they executed many times they are mapped to the internal port when Docker runs as a container you have like a virtual machine and it exposes internally the 88 port but for the host or whatever access where the Docker container is running it is exposed as that random port so the only way to access is through the the new port and that will redirect to the 88 that is defined internally the wildfire image ok so this works that way because as I can execute as I told you I can execute many containers and there won't be a port only if you run Docker native and you don't specify the minus P it will use the exposed port it will try to the 88 port is that right do you mean if I don't specify the minus P if you don't run in Docker machine if you run native the Docker host as local host and you don't specify the port you won't have access that's what happened here even using Docker machine locally it won't work because it's a a kind of security constraint and one I need to specify that those ports that are available I want to expose them to the outside world of the container well but as I said this seems odd for me I don't like that port number so it may raise a question can I specify the port myself? yes I can so instead of the where I say get all ports that are unexposed get that and and create random ports for me I can specify with lower case P the local port that I want to expose in the port of the container this is how I create a mapping myself of that container so if I run that and that's my Docker host oh yes Docker host ADA now I can have access on the port ADA because I specified that I want to run that container mapping the port ADA to the port to the port ADA of the container is that clear or is that okay? to run both it will tell me that there is a port conflict the ports are already allocated okay so for purpose of have escalation to scale your your containers it's very important to you to not specify the port and use a load balancer that will recognize those ports and and do the load balance between them okay so let's see what else container with specified port okay now some tricky commands suppose that I have here let me run many containers I run I have three containers executing on random ports two we use in random port one we use in port ADA and suppose that I want to stop all of them with docker stop I can pass commands for example I saw previously that I can do docker ps which will show me all the containers executing but I can do docker ps minus kill which will just return me the container IDs so I can do a docker stop and pass docker ps minus kill and it will stop all executing containers in a single command this is very handful and you will need to stop many containers or remove ps minus aq when you need to remove all containers in a single command instead of specifying 101 okay so now suppose sorry there are also some important to get those random ports because when I run like in Jenkins I need to get back those ports so how about it existing exposed ports well when you run the docker without specifying the ports it will show you the ports available in the docker ps you can do it you can look for example in the image so far let's get Jenkins that we get here of shell image of Jenkins most of the time it will say for me in the documentation for example docker run minus p88 and the port 50,000 I created containers on the Jenkins I see I create the same container of different versions but I need to get it back I understand so for example you want to get the port you can do docker port in the name of the command the name of the container this is the random name it will return for me the mapping or I can do a docker inspect let me get here the docker inspect you can use this complex command here should get the port for example docker inspect I need to here if you do docker inspect using this complex filter because the docker inspect get all information from the container it will get all information and with this format UIS specifying a filter that you want to get just was exposed on port 8080 so it will return just the port number or you can do just docker port and it will return you the mapping both ways work you're welcome so now another trick part of dealing with wildfly the default image exposes me the port 8080 but I need to have access to the administration of wildfly that doesn't exist on the default image so in this case I believe that the image was created that way for security purpose so if you want to have access to the administration you have to create an image yourself that will add an administrative user and expose the port 990 that was what I did in an image that I previously created so let me see show you here I have an image called wildfly admin that if I go to the docker file you will see here that I created a username that shows the port myself I customise it the existing jboss wildfly 10 image we will see how to create an image in some units but now let's see how to access the wildfly administration port so now I will run docker-it minus p because I want to get minus d minus p because I want to expose all ports in the following image that I have created before remember that it's my username so it's the image that I have created and I gave the name wildfly admin if I do a docker docker ps I will see that I have now two ports let me do a docker port I have the port 9.9 exposed as 3.2.775 so if I go here docker-host 3.2.775 now I have access to the administration console remember I created this customised image myself and I had a user with environment variables so here the default value is admin and the password is docker docker-it yes that's what we will see now so I have here this I have now access to the deployment to the administration console why I created these parameters here as environment variables to be able to overwrite these values so how do we do that let's stop the existing containers once more when I'm about to execute the command remember that I said it's important to give a name so it's more easy I have here we will see now another parameter which is minus E minus E allows me to specify environment variables inside the container so if I use here username equal devconf and minus E password equal devconf that's 123 now when we let me get the port number again which is 777 devconf devconf 123 I know this that didn't work because I previously created the image so what I should do is overwrite here after the execution of the container this image was created as a test purpose so that's why I didn't overwrite the value we can see that this environment variable was passed to the container by logging inside the container how can I do that well docker run creates a new container login inside this existing container here my wildfire so instead of do a docker run I can do a docker exec minus it and the name of the container and the process that I want to start inside the container in this case bash so I'm executing bash inside this container so inside the container now I can do a echo for example user name I have here the environment variables that was passed but I should overwrite here after the execution of the container this is crafted in the image that's why it didn't work the way to overwrite values inside the image how to pass in it using environment variables okay that's good to see that so I can change it later okay so this is the basic very basic off docker we saw how to expose ports how to run it in detected mode how to execute new process inside the image environment variables now we will see how to create our own image well to create our own image we will create a docker file as we saw here in many examples so for example let me create here my image every docker image has to every docker image source has to have this name docker file so there are just few commands to create an image basically you will specify the from which is the base image that you want to create for you for example suppose that you want to use the existing multiply image and now you can use any of these copy and run cmd and expose to create your own image for example suppose that you want to add or an application let me get an application here on my path an existing image here so we can move faster this is an example let me make it I will get the existing jboswild file image I can declare a mountainer and I can use the add to add a file I could use copy there are some small differences between them and I will add the ticket monster double war inside this deployment folder and now expose the part 8899 and 8809 because I was playing with mod cluster and finally I will run the full command for this container so once that I have a docker file what do I do to build this image I will do a docker build and specify a tag for so suppose that I want to give it a minewall fly ticket monster which is the name of it and the path of the docker file which is here when I do that if I put all these commands in an intermediate file system that's why when you are creating a docker command you will see different file system being created and finally we have the image my world fly my world fly ticket monster how can I do to run that docker run my anxiety my world fly ticket monster the world file is the source of the image it's inside the image yeah it's inside the image well in this case you are creating an image that have everything to run this application this ticket monster application so suppose that you want to deploy an application in a in a cluster so instead of running many containers of world fly and you have to deploy the application on all of them you just craft an image with everything built in with the data source created with the parameters of the JVM customize it suppose that you change the thread numbers of the world fly you make the customized image of world fly you can do that and simply ask for a person in the operations department to hey is it cool 100 containers of the ticket monster application and it will execute that part of the application you don't need to ask him to execute the world file and then deploy this world file image in all of them change the create an administrative user change the parameter of the JVM increase the size of the threads everything that you should do prepare your image to be executed should be made inside the image that's how you guarantee that the container that you execute in the development environment is the same one that will be tested and it's the same one that will land in the production you don't need to worry that they are different because everything is there that's the purpose of a container if you imagine a container it's something that you can put everything inside that's the purpose that's why you are instructed to have an application inside the image okay how do you view the continuous development in such environment continuous sorry continuous delivery well there is an initiative called Fabricate let me show you here Fabricate which is a project from Red Hat which has continuous pipeline it gets the source of your project creates an image and it allows you to propagate this image between environments so I suggest you to get a look in this project because this automates the process of continuous delivery so as you can see here so this Fabricate project allow you to have a control based on it will check the code from the version control generate an image during the build process and based on the feedback it will propagate the image to another environment so to return to our lab I will show you by the way if you have the image as we have here image we can see here the size of the image suppose that I want to export it to a file I can do a docker save the name of the image and the destination for example it will export the image suppose that you want to send that image to place it in a drop box or an append drive to send it to another person or in a network drive so you can this is how you can export the image and then later you can do a docker load and it will bring that image to the internal registry well we saw how to create the object the image wow something about docker is that containers should be what they call ephemeral the containers need to be discarded and recreated easily because that's important suppose that your application is crashing for overload it's overloaded and it's crashing instead of debugging why it's crashing why it's there is an issue with that container just discard that container and run a new image you don't need to worry because you can create as many containers as you want based on that image so the image is more important than the container and now you have everybody asking me but what about the states files that are inside the container it's a good practice to not store things inside the image besides the things that you need to execute for example that ticketmonster image has only the application but the data is stored in a database was that what you were about to ask it's possible to expose a folder from the container to to the dockerhose or to another container this is what we will see now as we create a port mapping we can create an application so that's why you have access to the this is how you externalize things from the container so for example let me show you here well this is how we executed the ticketmonster we have the application server and the database run inside the same image but also that I want to deploy the image myself so let's do what we learned docker run minus E minus V a folder here called deployments and I will map here to the port let me get here I will map my local port my local folder to inside jboss logfly send along deployments and I will run it as the invitation mode with my logfly and I will run the jboss image docker loves my msf my logfly image ok and I can see here that it created a deployment folder so let's keep it running the log this deployment folder is mapped to inside the container so I can simply move the application to inside this folder I believe that's what she asked right you want to update your application without stop so this is how I could also do is to have a mapping between the container and the file system ok so now that we know how to run the container with the application inside it and how to run application with where we can deploy the application inside the container using the the mapping between the folder and the container we will see how to execute two containers interacting between them having a database and the application talking to the database and this database is running as a container ok so to be able to two containers communicate to each other we have to create a network because with Docker since the version 1.9 we can also have isolated networks to create a container so with Docker network network we can go to LS which will show me the default networks and we can also create a network that can give a name for example MyNet so let's run for example a Postgres so let me call the command here and explain you minus minus name DB DetachedMode I'm exposing the port 5,4,3,2 to specify the network that I want to attach to that container and remember what I tried to show you in the this is how I can specify or overwrite the username and password in this image of course I need to fix my image to be able to specify an administrative user and here the Postgres username and password and the base image is Postgres now I have running the the DB the Postgres as a container and I need now to execute another container pointing to that to that container I try to customize the image with the wildfireticketmonster and what did I need to make if I go there minus f wildfireticketmonster you see here that's working this error is because it tried to drop the image but you see the application deployed and it's working nicely what I need to do I need to customize this image let me show you as I created this image here you can see that before deploying the application I executed a shell script that creates the data source installs the Postgres driver creates a data source here use the host called DB that's why I need to specify the container with the name DB so for example let's take a look inside that container minus it wildfireticketmonster bash when you run two containers in the same network it updates me the host file the IP address of each one so that's why inside the wildfireticketmonster I have the IP address of the DB that's how I'm able to have two containers communicating to each other container so do you communicate with one of the data bodies? yes so let's do that as it could now wildfireticketmonster2 of course with random port name with random ports now it is actually 3 and let's see the log of the database let's see wildfireticketmonster2 it started so that's why you can scale your containers ok so now you use this last 5 minutes to show you how to do that in an automatic way using Docker compose because everything that we need to do until now we need to use to learn the minus Z minus name minus net minus V to specify the volume and sometimes it's critical for us to have all those information in the in the console so let me queue the containers here what I needed to do to run that example I need to create the network I need to create the postgres container specifying the port the name of the network the environment variables and then I need to to execute the many ticketmonster application exposing the port so wouldn't be much more easy we define that in our file that we have here and specify everything in a YAML file and just say to docker run that for me so this is what docker compose does docker compose allows me to specify for example here the container name and I force it to use the container name because remember inside my image I'm expecting that the database is running inside the dbhost the name of the image the name of the net the ports that I want to open and the environment variables remember what I told to use a load balancer this is a container running multi cluster which is a load balancer for apesh so I have here the container name called mod cluster the network the image environment variables to define what IPs I should accept what port is it running and finally my wildfly image running on the same network so to run that I will use instead of docker run I will just do a docker compose minus b for the teshack mode and it will create all containers for me automatically to prove that I can do a docker ps look it created for me the postgres, the db and the multi cluster containers the docker and exposing the right ports for me so I can go here for example dockerhost on port 8080 and the multi cluster assessing the multi cluster and I have here the ticketmonster context available automatically for me I can do a docker let me go here I can do a docker compose ps it will list for me the name of the containers the commands which ports are available and I can do the thing that I really like about docker compose is this I can do a docker compose scale which serves I will scale wildfly and I want to have wildflies running and it will automatically create three wildflies for me and I can do docker compose logs and it will concatenate all logs for me that's why you are seeing wildfly 2 and 3 running and remember what I have told you about the load balancer because all of them are running in different ports they are not colliding so if I update here the load balancer you see here that I have host three containers pointing to to ticketmonster that allows me for example to do tests like for example so suppose that I am using the application and I want to docker compose scale wildfly wildfly docker 2 stop in one and I can for example try my application and see if it was not affected if the load balancer is working and the application was not affected of course I need to check it as you can see here I reduced the name of wildfly and now I just have two wildflies in my load balancer docker compose is the finally the way to scale your application so now we have five minutes or no we don't have five minutes questions no for database I really don't recommend to use a container in production because as I said it should be ephemeral I should just drop and recreate and I should keep the data out of the container because it would store files on local drive or substorage what is best practice for doing in docker they suggest I did here making a local volume in my computer they suggest to map that to other container instead of using minus V volume from I think that's the right switch to store the image in other container because with docker cluster I can have the docker demos spread in the network so I can't rely on just one volume just one machine holds the volume so docker allows you to specify a docker container just to store just to store information that's the recommend way yes definitely and guys thank you if you have any questions please don't hesitate and contact us okay and of course we will be outside if you want to continue our discussion about docker I will be very pleased to answer all questions thank you very much thank you are you? yeah fortunately we were we thought we would have more time but no worries we will have about 2 hours okay bye bye thank you hi how are you is this your clicker fantastic great I'll tell the volunteer thank you very much was it just outside great thank you Still made it. This player is... This. Yep. Fantastic. We'll try. We've got balls? Or not. It's fine. It's not talking. It's good. You need to do good. You need to do good. Speed. State. Time for something. I've got it all on the end of the game. Is that a game or not? It depends. We'll find out as of the requisition. It's fine. Okay. That's fine. You know, the buy-pies... Not great. Not that great. Okay. Last time, one of our players completely ruined one of the buy-downs. They played 60 max. So, okay. I think it is bigger than... Yeah. We'll find out. Yeah. Let's hope. Yeah. Great. Great. So, we're smart people. That's me. Yes. We can't see the sheet. Great. Where should I stick my stickers? On my laptop. I think I'll have it on my laptop. I have plenty of stickers on my laptop. There we go. Right. Let me get configured. Make sure we're working. Now we don't have time. There we go. And then... Yeah. Well, we'll see. We'll see how we go. Great. Thank you. Let's just check this present. Fantastic. You can. Yeah. Hey. Hi. Hey, hi. Nice to see you. Great. Are you my Kerberos guys? Yes. We are. Good to meet you. Well, don't feel like you have to sit in the session if this is boring. I can find you afterwards. Yes. Yeah. Yeah. Actually, with me. Great. I don't know them. I do a similar thing in the past. Again. So I must have a real job before I join. Let me just make sure that we just get to the scale. And I used to have the... I used to make cross-platform products up to Microsoft products before it came to Microsoft. So they made something similar. And so we had to reverse engineer NTLM V2 to get some work using the Kerberos MIT virus. And just that. So the guys in the end, I'm not sure actually they're the guys who own that pit for the networking. And I'm not sure how familiar they are with how much they do on the line. So I suspect they're taking... They're going for an easy route rather than the right one. Brilliant. Yeah. They shouldn't do anything. That's the answer of life. Yeah. Yeah. Exactly. Yeah. You will need to... It may sound very strange. You will need to help us educate our developers on that protocol. Okay. Because a lot of them, it's invisible to them. Yeah. Exactly. As you know, NTLM is just the same protocol over HTTP. So you have to reverse engineer it, did you, before the protocol got... Now it's the document. Yeah, exactly. Oh, really? I'm just making sure I don't use the presenter view. I just want to remember how I don't... Hey. Hello, yeah. I'm just going to introduce myself. I'm Riley Booker. Hi. I'm going to choose a couple of emails. Yes, yes, thank you. Martin, I was wondering if you could see someone from Microsoft New Region today, Daniel, or some of the evangelists from... I'm not sure if some of the evangelists are here. I'll find out. I've only literally just got here. Okay. So I will find out. But, yeah, if you come and grab me later on. I'm just talking to them. Okay. So I was like, yeah, I'll find them, and I'll agenda those. But get them to talk to me in the meantime. Yeah. Martin. Do you need a break, or will you continue this holiday break? Let's see how it goes. I would like to continue without a break, if it works. Okay, yes, yes. But feel free to... people just walk in and out. I'll be sitting there, and I will show you 10 minutes, the right 15 minutes before the end. Yeah, fantastic.