Docker Live! Running Docker containers in Azure ACI

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
we are live all right hello chad how are you i'm good let's pretend like let's pretend like we haven't been talking for the past five minutes [Laughter] sounds good it is a lovely lovely cold day in san francisco oh is it yeah i get a little jealous being here in texas see you guys um i'll see pictures on twitter or anything and everybody's got or we'll get on meetings and people have hoodies on i'm like it's 110 out here so i get a little a little jealous i think we're literally half i think today is is just over 60. you know yeah another quick side note and it's amazing to me no people in san francisco don't have acs when you had the heat wave i traveled there and they're like we don't have ac in the hotel room so sorry yeah it's in the foreign foreign to me from being a texan 100 well cool man i mean all the houses here are 100 years old so yeah there's just and they're all made of wood so right it's just kind of well cool well this is our hello everybody uh glad folks are joining we didn't really uh publish this much out there so i'm sure people will come on but uh yeah last week was our first time had some technical difficulties themes sing things uh seem to be running smooth now but um yeah if you're out there on the internets welcome feels uh we're gonna talk about aci and azure today we uh when did we announce that around dockercon correct yeah yeah it was dockercon yeah i gotta get a little for at least for me swept up in the dockercon storm just so many things going on then but yeah i just wrote a blog post monday man it was i really really enjoyed it it was smooth it was easy to use and it's not even uh it's still in beta right yeah yeah it's still in in really early beta um and so for folks that don't know um uh yeah at dockercon we announced it and i forget when the the beta shipped it shipped a couple weeks later but it's a it's a way to use uh docker run and docker compose with azure aci and so for if you haven't heard of aci it's the azure container interface um and it's a container runtime service and so you can give it a container and it'll run it for you um it's it's really kind of centered around a single container uh notionally uh effectively this a very similar idea to pod which typically you might have one one container in that pod [Music] good chad i'm sorry that that that was that was my that was me pulling up and getting some echo sorry sorry we're good i totally threw you off the pod i'm fine uh you got a pod kind of notion it's not it's not the same it's not 100 the same but it's very similar and so typically it's one container and maybe some sidecars or or something else but we did the work to make docker run and docker compose work because the way that you launch into aci you either use the azure cli or you write these other aisles of yaml and uh you have to learn something new and so we have talked to a lot of folks around it'd be great if i could go to these places but i would just keep using the same tools that i already know and so that was really the goal and so yeah it's it's it's pretty new um still got some rough edges as we work it out um but uh i definitely encourage folks to go look at it the way you would get it is to go get the latest docker desktop edge version for either map for windows um if you're on linux uh it's a little more complicated i think i think i might have lost you oh no uh-oh chad i think i might have lost you but i think what are you back you're back hello oh i'm back did i go away yeah just just just a little hiccup little glitch in the matrix there for a second but you were talking about you were talking about linux getting getting aci working on linux yeah so i i think right now for aci you can't do you can only use the one you can use mac or windows because you need docker desktop yeah there's some under the covers magic for what's why that is and it's just it's basically it's an experimental and it's difficult to install so we just took care of that in the experience but um yeah so yeah so that that shipped uh in beta we have a update coming with you know we've been we've been working on feedback from from folks and uh lots of echo all right let's see i'm good over here but yeah when while you mess around with that i'll i'll feel the awkward silence but uh but yeah like i said i was playing with it i kind of waited a little bit when it first when it first got out not an ounce but internally right i started playing around with it um but then i decided you know i'm gonna wait till it gets a little bit baked a little bit better and um yeah i was really impressed with just the ease of being able to switch my context into aci doing a docker compose up docker closed down even just uh docker run running a single image in aci um was super simple back before i came to docker i was working at a custom development shop and that it just would have been great to be able to use that for our clients to be able to um even update their production systems their stage systems or even just when you're developing a feature and want to deploy it very quickly to share with a pm or something or your team makes it makes it extremely easy just to switch your contacts and do a docker run run your image right in aci um so i and it's only going to get better from there um the integration is we're working closely with uh microsoft they're excited about it we are super excited about it um but yeah i think uh it might be cool to jump into to do some demos or yeah hopefully the hopefully the echo is gone folks yeah you you sound fine on my side so you want me to i'm gonna switch over and let you share yeah that sounds good okay so let me so somebody asked is this a replacement for kubernetes i i don't think it's a replacement i think what it is is it's an extension of using the tools you already use so if you if you use and if you use compose and you use docker you can continue to do that you just don't have to worry about in a cloud environment where you want to run it um also these are you know these are betas so i would not recommend right now doing production workloads in this so i think it really depends on you know what your what problems you're trying to solve um but yeah i don't think it's a replacement i think it's just a different it's a different more developer side focus so if you already use compose or if you like compose or if what you're doing fits very well into compose so like a talks to b b talks to c if you need lots of knobs and whistles to to tweak and turn about you know auto scaling and all of those pieces like that's that's probably another reason to use something like kubernetes if you need lots and lots of um sort of tailorability um if you are a developer team and you just want to get work done compose is pretty good for that so you know maybe we can just show an example of how that might work yeah cool um so the first thing you have to do is you have to get a context um and in docker we can do docker contacts and uh this is the context i have so i have a an aci context which is it happens to be in aci west i have an aws context so uh about a couple weeks ago we we announced the same thing for ecs and so i can deploy either to aci or to aws and then i have this default context uh which is it starred because it's my current context and what that is is my local my local docker right so if i do um docker run uh let's do uh yeah i'm going to choose nginx if i can actually type it um you know we're going to go to hub we're going to go download it um up and running so now i should be able to go to oops i don't want you nope one second getting the browser up there we go let's go to localhost 8000. so um right that it's very simple um and let's do that exact same thing but now do docker context use um i'm going to use aci west and now i'm going to do well i can i can so if i do this you're going to get an error and that's because right now we don't support port mapping um but we can just do 80. and that's part of the this is part of the beta yeah we'll we'll get that resolved as the beta goes on um you'll notice that it's a slightly different experience for the getting started but in the end you don't see the container pull basically um it takes a little bit longer for the container to start let's see but it's really relatively quick 20 to 21 seconds for the start and now we can go to let's create another let me just do really quick so um so we have the container running it's running nginx and here's the ip address so if we go to this and put in this ip address we have the same the same thing running so it's really around use the same tools and send it somewhere else so you know i just sent the same container to basically two different places and all i did was switch context um so i want to do this locally or i want to do this in aws yeah super cool so so this is uh this is the first of of the pieces for this if we go to github so let's go to um let's go to github docker um we're gonna go to the aci integration um so if you if you hit something you know please let us know um it also talks a little bit more about going to do it yeah and we do have a we do have a linux installation so you can also if you if you're on linux you can go get this and and and learn to install it i'm still echoing um let's see so youtube is off i don't have any anything there why am i echoing can you hear me chad let me let's see so all right chad we're gonna we're gonna live troubleshoot this so i'm on skype sending you that um i think the only thing i'm sending you is my is my voice i think i at least didn't think i was setting up skype to do anything else but let me see what else is in it might be on my site what can you hear me okay chad oh uh oh we might have just lost him well it looks like we just lost chad in the skype of course we said right before we got on all right well let's see what could go wrong what could possibly go wrong um we were thinking more of the demo but so maybe i will pick up um from where chad left off and let me get my screen set up and let me share okay cool so if you guys went through um i posted a blog post monday on deploying your images up into um aci so let's take a look let's see if i can um let's go here we'll go into safari and so if you go to docker.com blog and if you look at how to deploy containers so this is the blog post that i wrote if you want to follow along you can um you know run go up here let me let me throw this into the chat and so there's the blog post and you can see you basically walk down through uh logging into azure setting up your aci context all those type of things so i'm going to walk through that now and show you a little bit of the integration so let me jump over the console so the first thing we need to do is we're going to do a docker login and we're going to do an azure and so what that'll do is pull up the browser window it gives me a login screen if you don't have an account you'll be able to create a free account those type of things so let me choose my docker account and then this tells me okay you've been logged in you can close this screen so now once i've done that and come back to my terminal and you can see that i've been logged in i can't remember if i have a context set up already so let's list out the context so i don't um so what chad was talking about before you can think of a context of of a way to point your local docker engine a contact is basically somewhere where you can run containers and it's a little bit of a loose definition right now because we're starting to think about it not only local engine but an engine uh on azure and aci or some other cloud provider or internally you know in your own data center and so basically a docker context is the ability to be able to point to another engine and so right here you can see i have a default engine type mobi and that'll just point to my local docker instance so i can do docker ps say i don't have anything running let's take a look at what images i have okay so so now what i could do is set up a docker context and let's take a look at let's take a look at the help so docker context i can create one i can inspect and list remove show all the all the usual suspects here and if we take a look at our um so right here listing and then we can create one called aci so let's do i'm going to clear my screen so docker context create aci um oops and you have to name it sorry let me do that let's show the help real quick um so you have to give it a context which is the name and then you can pass in resource groups subscription ids uh the location um if you don't and what i'm going to show now is you'll get an interactive the ability uh docker cli will will ask you questions we'll go into interactive mode so so if we go to docker context create aci and let's call it my aci and it's going to ask me what do you want and so first thing it looks at is it finds my subscription so you can have multiple subscriptions i only have one i'm logged in so it uses that one and then it's going to look for a resource group i have a couple resource groups here i could choose one of those just by hitting down arrows up arrows or i can create a new one so if you don't have a resource group created if you choose this option it'll create one for you um let's go ahead and i'm going to create a new one so it set up a resource group for me here and we can see it's bay oh i like that so let's list out now we can now we can list out our contacts and you'll see i'm you can still use the uh gotta be able to spell docker uh context you can also do an ls same thing so you can see i still have my default which is one i talked about earlier and now i have a new one type is aci and you can see here the bay that was the same um the same resource group that was created up here okay cool so now we have our resource group set up our co and our contacts set up and so let's switch to use that context here's my aci and now if i do a docker contacts ls you can see that the star is now pointing to my aci so it's clear so it's the docker ps so now what this is doing when i'm when i'm doing a docker ps now my context is switched and it's pointing into aci it's going out and looking at aci that's why you saw that little bit of delay and i don't have anything running so i'm currently sitting in this little application called time stamper and let's take a look at the source so it's a very simple python app we have a docker docker compose file which is right here and we'll come back to this in a minute but then we have a docker file so dockerfile's very very straightforward docker file using python setting up our working directory copying on our requirements into app we're running pip to install things and then here we copy our source code in setting up our entry point and then running the command right pretty pretty straightforward for a little pretty simple docker file and so let's use that um let's build our image so we can do a docker um let me oh well let me show you this so if i do a docker build here let's give it a tag and we'll just say test and oh i need to move into app and well it's telling the same thing i should read i should read the error messages before i move on but so it's telling me the command build is not available for the current context aci right so let's let's switch back to our uh context then we'll go back to the default we've got to do a use all right so now we can do a docker build and that should be fine it's building it locally building our image but one of the really cool powerful things if you look at earlier chad was showing how he just ran a single container he pointed at the context in the aci and he ran nginx upon aci that was just with one container but with this app i want to be able to show how you can run uh using compose so if we take a look at our compose file we have our services and then we have a front end and we have a back end in our front end we tell it to build in the app because in our app directory that's where our docker file is located and then here i'm going to give it an image name we'll come we'll come back to this in a second and then expose port 5000 and i tell it you depend on the back end so wait for the back end to start up before you start up the front and then our back end is just made up of a a redis database um and so very again a very kind of straightforward uh compose file so what i'm going to do is here you need to change and point to your hub docker id so if i come into hub the docker id docker.com and you can see i'm using p mckee so that's this is your docker id located up here at the top let me log out and use your docker id you can create one here right on hub.com or you can sign in with this button or this button i will use the fancy dancy uh finger and there we go i'm in pima key so that's why i changed this to pima key before it was just saying username so what that's going to do is aci is will connect into hub and we'll pull your images from hub so i'm going to build my image and then i'm going to push it up into hub and then i'm going to run the application on aci but before i do that let's save that let's run it locally so what context am i on so you can see i'm on the default context so there we go there's our composer let's just do a docker compose we'll do an up and i'm going to give it a dash dash build to tell it to build build my images and then bring everything up running while that's building let me look at the questions here chad likes to hear his own voice probably but he's not that type of guy i don't think so yeah twitch yeah we've been thinking about twitch for a bit all right so we built the image and it's up and running you can see we're listening on port 5000 so let's go ahead and open up my trusty uh brave browser so localhost 5000 and there we go there's the application running if you look at the terminal you can see i've we have a get with the 200 and then we get a 404 because we don't have a 5 uh fave icon so let's run it a couple times time stamp you can see in the console i'm getting requests okay so did a ctrl c to bring that down let's do a docker compose down okay so now so we ran that locally no problem built the image no problem so i'm going to do a docker compose push i'm going to push my image my p mckee time stamper up in the hub and give that a second to complete okay and now i'm going to switch over to to use my aci context so docker context use my aci so there we go so docker contacts ls again you can see the star we're pointing right there and so now what we should be able to do is do a docker compose up and spin our application up into aci so let's do that now docker compose up and you can see it's running uh zero of one so time stamper has been created um and now it's creating the two instances front end to back end these names if you saw chad when he did his quick little demo um it was some random name when he ran one container that's because he didn't name his container so aci will will choose a random name just like when you run docker run local if you don't give it a name it'll randomly choose a name for your container but with compose it looks at your directory your folder that you're working in and you can see here ours is time stamper so it'll use that as the container service and then it looks at each of the services inside of your compose file and we have front-end and back-end so that's how they're being named using a compose file when i didn't give it a a name but with docker compose you can give it um a project name i think it's actually on docker compose up let me clear this so you can see it a little bit better yeah so when you do a docker pose up you can give a dash p or a dash dash project name and give it a string and that will be the name uh instead of time stamper you can change that time stamper again being the folder that i'm currently in so you can pass in the project name that you want to use in aci okay cool so um we were up and running so let's do a docker ps there we go we can see our two two images are running our two containers and here's the container id front end timestamper back end so let's grab this ip address and you can see the port mapping marked here so come back now this is local we should get an error there we go so let's open up a new one and now we're going to that ip address that i grabbed out of ps and there we are we're up and running and we're getting time stamps so super simple very easily just to review what i did real quick um i'll get to the questions in a minute uh give me one second but um just to review real quick so at the very beginning i logged into azure so i did a docker login azure now logging into azure has been integrated right into our docker login so you don't have to download the azure cli as you can see i'm pretty sure it's a z i don't even have that installed so you do a docker login and give it azure that'll open up your browser allow you to log in and then we'll tell the cli give your credentials and then we set up a context so we did a context create and we gave it the type of aci and then we named it my aci after that we were able to list out our context and talked about the default context that comes with your desktop install and then you can see the stars always pointing to the context that you're working on and then i um then we switch back to default we spun the application up locally made sure it was working we build our images we push those images up into hub and then we switch back into using the aci context and did a docker space compose up to run in aci and again we're up and running pretty pretty smoothly you can also do so docker ps now you can see i'm pointing up into uh into aci in the cloud so if i if i did a docker context got to be able to type use defaults and then docker ps we don't see anything running you can also do um you can give docker command you can pass the the context to it so my aci then do a ps so even though now my my default uh the context i'm currently using is default if you patch a dash dash context into docker the root command docker and give it what context you want to use then anything after that will be applied to that context so it gives it a quick little shortcut if you if you were in one context and you want to peek over to another real quick without switching you can use the dash context um so let's let's move back docker context use my aci okay drp whoops docker ps and there we go um [Music] let me take a look and see if there's any questions so what's the best practice for hosting your application in docker do you recommend copying the app inside during the build step or create a volume at runtime via compose um not exactly sure what you're asking there but yeah i i would copy your application into your image and then only use volumes for persistent data that's for if you're running in in an environment in a cloud of public cloud private cloud and you want that up and running all the time local development is a little bit different that's where you can use you can mount to volume mount your local file system and have your container up and running but still pointing at your file system where you're editing your files and those will be reflected in your container so if you're kind of doing live development let's say with node and you have nodemon running inside of your container and it's watching a volume a mounted volume but it's on your local machine anytime you change a file there will be reflected inside of the inside of the container so you can do you can develop inside of your container um but for when you're running in um in a production mode or in a staging mode something like that copy those files into your image and run your application inside of the container and then use volumes for persisting data hopefully that answered your question um how do you manage your logs are they persistent are they persistent they're persistent inside of the container while you're running but once you stop everything they're gone you can use different tools and production to pipe those logs standard in standard out standard error best practices when you're running in containers you want to back you know a couple years when you're not running inside of containers you're usually writing to you're logging into a file and you might have multiple files you might have a standard out and an error file now when you're running containers kind of the best practices is you want to pipe out to the standard out in standard error and then you want to have another process a mechanism of reading those in and piping those into um some kind of log stash or um you know some other logging tool outside of your application in your in your cluster and you can watch the logs there um so that that's a little bit of problem if you're taking i hate to say legacy but if you're moving an application from kind of a standalone running on a vm by itself and putting it into a container when you're running on that vm you might have been piping your logs into um into an actual file and rolling those log files and collecting them and processing later you could still do that and you can use volumes to write to those logs and then pull those over that might be an intermediate step but i would suggest think about deeply about writing just the standard out and then then you can pipe and stream those logs wherever you need to um cool okay so let's see what else is in in um in the blog post i just want to maybe go through a couple other things here so sorry for the fast scrolling um but again go run down through this blog post uh reach out to me on twitter p mckee if you got any questions um love to help but this should walk you through everything but we wanted to show um one to show it live today um yeah okay so let's let's do logs so let's see what context we're using because i forget okay so we're on aci so doc or ps everything is running still so you can do docker logs and let's do time stamper underscore front end so there's our front end logs sorry for that let me come over here let's hit this a couple times and i'll come back run logs again and we can see more we can also follow the logs uh let me clear so now we're following them i come over get a couple send a couple more time stamps and you'll see those logs being pumped out we can also look at our back end so you can see it's it's our our redis database and we're ready to accept connections let's see if we get some some logs pumped out not sure what level logging i have with the redis but you can see there there if i had more debugging logging on those transactions would be pumped out here so yeah so very simple so let's let's take it down let's go docker compose down that will tear everything down stop my images um now if we do a docker ps it's not running anymore and there's some commands that not all flags not all commands make sense not all flags um makes sense um so one of them is the dash a right now when you uh either stop or remove your container in aci i'm sorry not stop you either run you either start or remove your container um we don't have this concept right now stopping them uh as far as i know not 100 sure if that's coming but um yeah let's see what else um again you can't list your images so doing a docker images um as you can see it's currently not available available in this context um which kind of makes sense um but all other kind of commands are very very simple so again let me do the docker so let's go in let me let me start it back up i'm going to do a docker compose up let's see how quickly this goes trying to get the seconds here make this a little better let's see what happens if i do that there we go ah we can see see chad's in the chat hi chad not sure what happened okay cool so took about 25 seconds so let's jump over into let's go into azure and let's look at my accounts well you need to sign in okay go into the portal and then let's take a look at our we can see the resource groups let's go look there because i created a new resource group when we started give it a sec okay so i believe we we created this one that's bae so if you click on that you can go and see all your everything that's associated with your resource group let's go back into home let's take a look at our container instances so you can see we have time stamper running it tells us it's in this resource group so if you look at container instances you can see you can uh view your cpu and memory and network info all those type of things then we could come over here and take a look at our containers and you can see we have a front end back end and then we also have this uh aci dns side card uh this is used for dns obviously it has the dns in it but here's our two images and you can see here that the front end image is coming from p mckee for its last timestamper that's my hub account right uh this is my hub namespace and this is the image name and so the so this is together that's called a repository so it's pulling that image out of the hub repository which is pretty cool so i just pushed up in the hub spun up my containers in the aci and they pulled those down and then we see we have our back end running so pretty cool pretty simple that's kind of a whirlwind tour of uh aci but let's see if we have any questions yeah so chad chad hit my uh answer there so yeah there's no concept of stopping in aci right now all right so i don't see any more please please put in your questions if you have any chad's there to answer i'm there to answer let me know um also too we're going to be doing a uh a getting started ama as a live stream um i'll come in so you can see my face a little bit better um so there's chad frozen in time sorry chad it's a it's a good side it's a good side though anyway so um we're gonna be doing uh planning on doing an ama ask me anything ask chad anything and we really want to kind of focus that on the getting started so there's a lot of folks uh that are new to docker um you know there's there's um you know there's a getting started where you come and run a little hello world tutorial and you kind of get the concepts of a docker file compose file how to create an image how to run an image in a container run container start and stop those type of things and then then the challenge is okay now um i want to take my application and i want to containerize it and that's where a lot of the beginner questions come out um you know what base image do i use what exactly is the difference between an image in a container how many processes should i run inside of a container should i run my database inside of a container how do i do that how do i connect my application to my database running locally so you get into some networking questions how do i persist data how do i map in my development files into my running container so all those kind of um you know found i hate to say basic because they're not basic all those foundational questions we want to address to help people come up to speed as quickly as possible so look for that keep an eye on our twitter channel um you know follow me and chad on twitter and we will tweet out you know when we're going to go live for that we're going live every thursday at um 10 p.m pacific time noon central time and one o'clock eastern time but and these are you know we'll then these will then be hosted on youtube so you can go back and watch them again in case you missed anything but um yeah so look for that to be coming you know think of your questions tweet tweet me some questions um tweet chad some questions uh show up in the live chat ask ask any questions you have there let me go look in the live chat now yeah how to make persistent volumes yeah that's the um that's always a great question i think we'll actually do a live stream on that it's a little bit more in depth to answer in a couple minutes um but basically you have to you can have docker manage your volumes and uh docker will take care of where that data is stored um and you can use plugins on the different cloud providers uh to be able to put those into a persistent store um in azure or aws running locally though if you want to persist your data i use volumes locally and so when i run up spin up a database running locally i just have its data being stored in a volume and then i connect with my different applications into that uh into that database and i always have that volume so when i start and stop my containers i always connect into that volume so that the volume persists that way and i let docker take care of it a lot of times when i'm doing local development on let's say node.js i'll map i'll mount my local file system instead of letting docker manage the volume i'll mount my local file system where my source code is at and so that that way when i make changes on to a source file it's reflected inside the running container up in the in the public clouds or even your pirate clouds it gets a little more complex than that but um i think it's a good topic people a lot of people ask about that um let's see is google cloud integration in the roadmap i think that's a great addition david you should add to our roadmap and that is in uh if you go to github i'll dump the i'll dump the link into the chat here so it's github basically docker roadmap so please put the put a put an issue in our roadmap um and that'll get prioritized just reading questions oh sorry chad i just saw you put the road map uh tar it's hard to read chat as they're flying by and seeing which ones chad answered or not awesome let's see what else i could talk about around this getting a swarm question i'm not sure rajit's uh not sure exactly what you're asking why you should use swarm swarm is great swarm is um has moved to the mirantis uh side of where they're supporting that keeping it up and running uh so we focus back more on the development experience and helping you get your code from your desktop working dev environment up into a cloud whether it's public or private and that could be into a swarm cluster that could be in kubernetes cluster that could be an aci ecs whatever it is we're really focusing on helping you get into those clouds helping you run your code as simple as possible all right so just let me do a see if we have any more questions coming through let me just do a again a really quick recap and so okay so the first thing i did is was a docker login azure to log into azure and then i created a context and i pointed uh my docker engine up into the cloud aci um and you can also run and to see what context you have is a context ls or a list all right and you can also now we're pointing at aci you can see that here and i can do a docker run uh dash p 80 colon 80 um dash name web and nginx now you can see spinning up the web spinning up a single container and let's see if we can get done before 20 seconds 15 i don't know let's hope my prediction would go quicker but um there we go 21. relatively quick for spinning all that up into uh actually it's pretty darn quick spinning everything up in the aci and getting it running um i am let's come over here make this a little bit bigger so y'all can see sorry for the fast moving around of screens good enough um again pointing out aci so let me do a docker ps and there we go we have our we have our time stamper app still running and now we have a container named web and it's running on 20.185.9715 and it's running on port 80. so there's our nginx spun up a container very fast like 20 seconds in the aci so let's do docker remove uh web docker ps not running anymore let's test that it's gone so that quick spun up on nginx server and aci and brought it back down single container using just standard docker run docker remove um and then we also have integrated in with compose so you can see i'm in the root of the directory here i have a docker compose let's go down why down because let's do a ps real quick look at our process is running you can see i have time stamper already running so let's tear that down do docker down whoops docker compose down oh no i'm not sharing my screen lovely uh newbie streamer mistake who was that who's it thanks alex terribly sorry okay let me run through that again then so first thing we did was the docker login azure opens up the website i click login we come it tells me yep you've logged in you can close this window if we come back to uh the console you can see i'm logged in we can look at our contacts i already have an aci context set up but let's do another one real quick so i do docker context create um and let me give it a help here so i can show you so create a juror container instance um so you can do from host you could do a bunch of flags here so let me didn't want to show all that so let's do docker um context create aci and i'm going to say let's just call it aci i have a couple resource groups already i'm going to choose one that i already have available if you want to create a new one just choose that obviously up and down arrows and there we go so now i'm using that resource group context ls now i have two aci context so i could in theory point at two resource groups i could use one for my stage one for development and then one into production right so we could have a local resource group that everybody on the development team is kind of using and starting startup in containers um you can have your own that you're just using to show uh say you're working on a nice little feature you want to share with the pm real quick you can spin your container up on aci in your own resource have him or her look at it tear it down very quickly so created a context and then you set what context you want to use by doing a docker context use let's use aci now i'm using that context i know that because i can do a dot context ls and we see this star is pointing to the new one i just created and then i could do a docker ps nothing isn't running um do a docker run 80 call on any we'll do our infamous engine x give it a web 2 and nginx uh didn't like that because it's not it's the name there we go so again spinning it up should take about 20 seconds okay good alex you can see sorry about that yeah carl um you can tweet either at chad or or me um my handle is p mckee uh the letter p and then m c k e e chad drop your drop your uh twitter handle in here mine is p mckee chad i forget yours forgive me um but yeah tweet us some questions um love to hear from you and then also if you jump on uh live and ask a question we'll address them also again the these first amas we want to do is keep it more for getting started more of the foundational um issues so thank you david put an issue on the roadmap excellent okay so we're up and running uh with our nginx oh docker ps there c is our web 2. let's take a look at the logs docker logs web 2. there we go you can also follow those so now we're following let me grab this port or this ip there we go and there you go you see the logs being piped out awesome so docker remove let's clear my screen so again we can run the standard docker commands docker remove web 2. and there we go it has been stopped and removed and there we go we get a not even a 404 can't even find it awesome and then real quickly let me let me just show in case some folks joined a little bit later how to make static ips in aci you know what i'm not 100 sure i don't believe we're uh supporting that right now so so i'm in the root of this project and you see i have a docker compose file let me open up the source so you can see a compose file we have a front end and a back end service our front end user is going to use the app directory the build because that's where our docker file is located when it builds it the image that will be produced is pima key forward slash time stamper and we're going to map the ports 5000 and then we tell it wait for the back end to start up before you start up and then our backend service is just the redis database all right dockerfile again is very straightforward using python 3.7 alpine setting our working directory copying our requirements file in running pip to install everything copying the source code in setting up our entry point and what command we want to use very basic docker file but but very solid docker file um and so let's run that local so i'm gonna switch my contacts to use the default so docker context ls we're using default i'm gonna do a docker dash compose up i'm gonna give it a dash dash build to make sure we build the images they've already been built so spins up pretty quickly let's go into a local host five thousand and there we go you can see we're running here there's my requests pull that down let me do a docker compose down all right now let's just switch our context uh for context use uh let's use aci and then let's do a docker compose up that'll look again defaults to docker dash compose.yaml looks in that file uses our directory timestamp for the container instances and then has individual instances here back in and front end based on the compose file the surfaces we have inside of the compose file so we're done let's do a docker ps and there we go there's our running containers 224 on port 5000 there we are running aci we get our time stamps boom awesome let's see what kind of questions we got coming in here thank you for putting issues on the roadmap appreciate it i'm not sure if you can expose more than one port right now using aci i'm gonna go i'll look into that i do not believe so right now you know we're kind of still in beta so this is there's some early bits but it's features are coming quickly um i'll check on that i'm i'm not 100 sure you can't you can map using compose other ports so you saw how i just ran port 5000 here and i did that in my compose file i just exposed the port 5000 and mapped it to 5000. all right see what else we have in here awesome okay well again sorry for the little bit of technical difficulties uh last week it was my machine this week it might have been chad's i don't hopefully i didn't hang up on him forgive me chad if i did um awesome but uh yeah we're gonna do this a lot more regularly regularly on thursdays here at 10 a.m pacific time so please join us uh every thursday on the youtube channel get it live streamed come ask your questions please give us topics you'd like to hear but um yeah looking forward to doing more of these this is fun um love the interaction i appreciate everybody showing up listening to me ramble on a little bit switch madly between screens but um yeah i hope it was fun for you guys uh stay tuned more to come we'll be back on next week all right thanks everybody bye you
Info
Channel: Docker
Views: 1,579
Rating: undefined out of 5
Keywords:
Id: EPvx14OCO6g
Channel Id: undefined
Length: 62min 15sec (3735 seconds)
Published: Thu Jul 16 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.