1 00:00:00,810 --> 00:00:05,760 Much earlier in this course like in the first one or two sections you saw me start up a new copy of 2 00:00:05,840 --> 00:00:09,690 red on my computer by using Docker as a reminder. 3 00:00:09,700 --> 00:00:14,670 Reddest is an in-memory data store that is very commonly used with web applications. 4 00:00:14,670 --> 00:00:19,620 You saw me start up a red it's instance using Docker and it seemed to be really easy and very straightforward 5 00:00:20,040 --> 00:00:23,670 but I'm going to show you kind of an oddity around using red is with Docker. 6 00:00:23,670 --> 00:00:29,970 Very quickly I took the liberty of installing red reds on my local machine directly without Docker being 7 00:00:29,970 --> 00:00:35,570 involved whatsoever because I want to show you the normal way in which we might interact with reds. 8 00:00:35,600 --> 00:00:39,390 I'm going to first start up an instance of the red a server by running red a server. 9 00:00:39,390 --> 00:00:44,910 Now again I am able to run this command because I installed red is on my local machine without Docker 10 00:00:44,910 --> 00:00:45,730 involved. 11 00:00:45,750 --> 00:00:48,920 Chances are you do not have red is installed on your computer. 12 00:00:48,990 --> 00:00:53,240 So don't try to run this command because it's probably going to result in an error. 13 00:00:53,240 --> 00:00:57,150 Now when I run that command you're gonna see that yep I get an instance of the red a server running 14 00:00:57,450 --> 00:01:03,960 it's in memory it's ready to store data or do whatever I need it to do that one the very common ways 15 00:01:03,960 --> 00:01:09,150 in which we can kind of poke into this thing or into the server and inspect the data that is inside 16 00:01:09,150 --> 00:01:13,470 of it is by using a second program called the red is CLIA. 17 00:01:13,920 --> 00:01:19,230 So on my computer I've already got red a server running I'm going to now start up a second program called 18 00:01:19,260 --> 00:01:24,030 Red is CLIA and again the entire purpose of the thing is to kind of reach into that server and poke 19 00:01:24,030 --> 00:01:25,090 around inside of it. 20 00:01:26,190 --> 00:01:31,280 So I'm going to open up a second terminal window and I'll run red is CLIA. 21 00:01:31,960 --> 00:01:36,360 And that gives me a little prompt right here that allows me to issue commands directly to the running 22 00:01:36,420 --> 00:01:37,330 red a server. 23 00:01:37,390 --> 00:01:46,890 And so I can do something like store my number or not store but set my number is five and then I can 24 00:01:46,890 --> 00:01:51,300 then retrieve that value and it prints out five. 25 00:01:51,350 --> 00:01:55,610 So this right here is the normal interaction that you would see with red s with red CLIA. 26 00:01:56,090 --> 00:02:01,010 Clearly it's really nice to be able to run the red AC lie and interact directly with information inside 27 00:02:01,010 --> 00:02:02,650 that running red a server. 28 00:02:02,660 --> 00:02:02,870 All right. 29 00:02:02,870 --> 00:02:05,180 So now you're probably wondering where am I going with this. 30 00:02:05,180 --> 00:02:10,550 Well let's try starting up red is using Docker and then you're going to very quickly see some interesting 31 00:02:10,550 --> 00:02:12,720 behavior around Red as Seelye. 32 00:02:12,830 --> 00:02:14,350 So let's give it a shot. 33 00:02:14,390 --> 00:02:21,460 I'm going to stop my running stuff and then I'm going to start up an instance of red is on my machine 34 00:02:21,700 --> 00:02:27,480 using Docker run red it's now it's going to start up just about instantly for me. 35 00:02:27,520 --> 00:02:31,660 For you it might take a second or two as it has to download the image but overall it should be pretty 36 00:02:31,660 --> 00:02:35,710 darn quick when you start up red as you might see a couple of warnings. 37 00:02:35,710 --> 00:02:36,640 Those are truly fine. 38 00:02:36,640 --> 00:02:37,730 You can ignore them. 39 00:02:37,840 --> 00:02:42,600 Just make sure that the very last line that you see is something it says ready to accept connections. 40 00:02:42,640 --> 00:02:45,060 So as long as you see that you're good to go. 41 00:02:45,070 --> 00:02:45,250 All right. 42 00:02:45,250 --> 00:02:46,070 So this right here. 43 00:02:46,090 --> 00:02:48,730 Well we are running right here is the red is server. 44 00:02:48,730 --> 00:02:53,530 So I now want to start up a copy of the red a Seelye and tried to work with the information that is 45 00:02:53,530 --> 00:02:56,620 being handled inside of the server. 46 00:02:56,620 --> 00:03:02,500 As you saw just a moment ago I was able to open up a second console window and run red to see a light. 47 00:03:02,530 --> 00:03:08,080 So maybe four dark or being involved here maybe we just have to run like red Acela here. 48 00:03:08,090 --> 00:03:10,130 Oh no that clearly doesn't do anything. 49 00:03:10,150 --> 00:03:13,650 Maybe we need to start up a second terminal window and tried running right Acela there. 50 00:03:13,660 --> 00:03:14,400 Let's try that. 51 00:03:14,950 --> 00:03:18,730 We'll open up a second window and then run red a a. 52 00:03:18,800 --> 00:03:22,720 Now chances are you're going to see a message that says something like command not recognize or command 53 00:03:22,720 --> 00:03:23,500 not found. 54 00:03:23,590 --> 00:03:26,360 I see something and says could not connect to read us. 55 00:03:26,410 --> 00:03:27,820 So what's going on here. 56 00:03:27,820 --> 00:03:34,590 Well let's look at a diagram so just a second ago we started up a new container that is running red 57 00:03:34,600 --> 00:03:39,290 as server now red is is running only inside this container. 58 00:03:39,300 --> 00:03:46,230 So if I tried to run red this Seelye outside the container outside the container I have no access to 59 00:03:46,230 --> 00:03:47,880 anything that's going on inside there. 60 00:03:48,180 --> 00:03:52,070 And so there is no red Acela command to run outside the container. 61 00:03:52,560 --> 00:04:00,210 If we want to start up the ally we need to somehow get in to this container and execute a second command 62 00:04:00,270 --> 00:04:02,250 inside of it like this. 63 00:04:02,250 --> 00:04:07,470 We need to start up a second program inside the container so to figure out how to do so let's take a 64 00:04:07,470 --> 00:04:08,020 quick break. 65 00:04:08,040 --> 00:04:13,230 We'll come back the next section and figure out how we can execute a second command inside of a running 66 00:04:13,230 --> 00:04:14,140 container. 67 00:04:14,310 --> 00:04:15,390 So see you in just a minute.