In last section we learned how to start up a shell inside of a container at the instant that it was
started.
By the way if you have a little bit of trouble exiting from this by hitting control C which is usually
how we exit out of a container remember you can either press controlled D on your keyboard or you can
just type in exit like so and it will kick you back out.
Now in this section there's one very small gotcha maybe not even a gotcha but just a very particular
thing that I want to go over to make sure that it's really crystal clear on how containers behave.
I want you to recall back to a little bit ago when we were initially talking about what a container
is.
Remember that we gave this example of where Chrome had needed a particular version of Python and no
J.S. needed its own version of Python and we had said that through that name spacing feature we can
kind of imagine that our hard disk had two little segments carved out of it.
And anytime chrome tried to access that hard drive it would get its own segment any time no J.S. tried
to access the hard drive it would get its own different segment and so the thing that wants to make
sure is really crystal clear is that between two containers they do not automatically share their file
system.
We're gonna do a quick demo inside of our terminal just to really confirm that that is the case.
So I'm going to open up my terminal and I'm going to start up a new instance of that busy box image
and I'm going to start up a shell inside there.
So I'll do Docker run dash I.T. Busy Box shell.
So now I can list my files and folders inside of here and I see just these default folders I'm now going
to open up a second terminal window and I'm going to start a second container with the same parameters.
So second turn a window and I'll do Docker run dash I.T. Busy Box SDH now going to open up one more
terminal window.
So this is gonna be a third one and inside of here I'll do Docker piece and I can verify that I have
two separate containers both running a show.
Now I'm gonna go to the first terminal window and inside of here I'm going to create a new file with
touch.
Hi there like so that's going gonna create a new file called Hi there.
There it is right there I can run less and I'll see the file up here right away.
Now here's the fun part.
We're gonna go over these second terminal window and I'll do an Ellis over here as well.
And of course I am not going to see that file of hi there because these two running containers have
absolutely completely separate file systems and there's no sharing of data between the two.
Again this is kind of a small thing but I just want to make sure there was very crystal clear.
So in general unless you and I specifically form up a connection between two containers we really consider
them to be more or less completely isolated from each other and totally separate.
All right.
So that's pretty much it.
On the basics of Docker so we're gonna take a quick pause right here.
We're gonna come back the next section.
We're gonna start moving on to the next big topic that we're going to cover.
So I'll see you in just a minute.