1
00:00:00,000 --> 00:00:13,600
Okay, to start a container based on an NGINX image, and also with some port accessibility,

2
00:00:13,600 --> 00:00:22,120
we need docker run, minus D for the detached mode, minus P 80 88 colon 80, because NGINX

3
00:00:22,120 --> 00:00:30,840
by default listens on port 80, NGINX. And then docker ps is showing that the container

4
00:00:30,840 --> 00:00:37,680
is running, and I'm looking for vigilant Antonelli, which we can see right here, started four

5
00:00:37,680 --> 00:00:46,240
seconds ago. So if I want, I can use docker stop vigilant Antonelli, that will stop it.

6
00:00:46,240 --> 00:00:52,000
And then remove the container image. Now if I use docker images, I can see all the images.

7
00:00:52,000 --> 00:00:59,439
And if I use docker image, remove NGINX, do you think that's going to work? No, it's not

8
00:00:59,439 --> 00:01:04,639
for the simple reason that we have another container that is currently running based

9
00:01:04,639 --> 00:01:10,760
on that image. Now, it's not a very good idea to remove the image, not even a force remove,

10
00:01:10,760 --> 00:01:16,639
because that will crash the other image. But if you want to, I can show you how to remove

11
00:01:16,639 --> 00:01:24,000
another image, docker image remove, or docker RMI, that will also work. Docker image remove

12
00:01:24,000 --> 00:01:29,599
is the new command, docker RMI is the old way. So I'm going to use docker image remove

13
00:01:29,599 --> 00:01:36,519
on busy box. And oh no, there we can also see it's used by a container. But this time,

14
00:01:36,519 --> 00:01:44,400
it's a container that's no longer running. So docker RMI minus minus force is what you

15
00:01:44,400 --> 00:01:49,599
can do to force it off. That will remove the container and also the container image.

