In last section we started up a new copy of the reddest container image inside there.
We have a running copy of the red a server and we now need to figure out how we can somehow start up
the reddest Seelye.
Also inside of that container to do so we're going to be making use of another Docker command so the
docker command we're going to use is Docker.
Exactly.
Short for execute and we use it to execute an additional command inside of a container.
We're going to write Docker exec well then put down I T dash I T.
This little argument right here allows us to type input directly into the container we then provide
the container I.D. and then the command that we want to execute inside the container.
So let's try doing this right now and seeing what happens.
I'm going to first go back over to my terminal.
I'm going to verify that my red is container is still running.
I can either look at it inside the running window or alternatively I could run Docker P.S. and see yep
I still have that red is image still going.
So then to start up a second program inside the container or run a docker exec loops forgot one thing
here we got to get the containers I.D. We'll do Docker P.S. And there's the idea right there.
So I'll do Docker exec dash I.T. I'll paste in the I.D. and then the command that I want to execute
inside there is reticence dash CSI.
And when I do so you'll see that I now get that a little bit more familiar looking command prompt here
and I can write out something like set my value five and get my value in it retrieves five.
So by using the exact command we were able to start up a second running program inside of our container
and the dash I.T. flag right here allowed us to enter in text on our keyboard and have it be sent into
that running container as a very quick exercise let's try removing the I.T. flag there and seeing what
happens.
I'm going to exit this by hitting control see on my keyboard and then I'll do Docker exact again but
this time I'm going to leave off the I.T. flags.
So I'll do Docker exactly the I.D. and then read as CLIA and you'll notice that this time around I just
got kicked directly back to my terminal.
I got kicked directly back because red AC Ly was started up but we did not get the ability to enter
in any text.
So when Red Acela was started up but it very quickly realized hey I don't have any possibility of getting
any text input it decided to just entirely closed down and kick us back to our terminal.
Now this idea behind kind of adding on the side t flag and adding in text here is actually something
that's rather important in the world of Docker.
So let's take a quick pause right here and we're going to come back in the next section and kind of
expand upon what I.T. right here means.
So I'll see you in just a minute.