-: In last section, we learned how to start up a shell
inside of a container 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 control 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 NodeJS needed it's own version of Python.
And we had said that through that name spacing feature
we can kind of imagine that our hard disc
had two little segments carved out of it,
and any time Chrome tried to access that hard drive
it would get it's own segment.
Any time NodeJS tried to access the hard drive
it would get it's own different segment.
And so the thing that I want 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 gonna open up my terminal and I'm going to start up
a new instance of that BusyBox image,
and I'm gonna start up a shell inside there.
So I'll do docker run -it busybox 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 terminal window,
and I'll do docker run -it busybox sh.
Now I'm gonna open up one more terminal window,
so this is gonna be a third one.
And inside of here I'll do docker ps,
and I can verify that I have two separate containers,
both running a shell.
Now I'm gonna go to the first terminal window
and inside of here I'm gonna create a new file
with touch hi there, like so.
That's gonna create a new file called Hi There.
There it is right there,
I can li- run LS and I'll see the file up here right away.
Now here's the fun part.
We're gonna go over to the second terminal window,
and I'll do an LS over here as well.
And of course, I am not gonna 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 wanted
to make sure that it was very crystal clear.
So in general, unless you and I specifically form up
a connection between two containers,
we really considered them to be more or less
completely isolated from each other and totally separate.
Alright, 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 and 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.