---
# System prepended metadata

title: Docker command

---

# Docker command

## list all container

```
docker ps -a
```

## list all image

```
docker images
```

## Downaload docker-imager form official

Example: Ubuntu 18.04

```
docker pull ubuntu:18.04
```

## Run Docker image with tty mode

```
docker run --name u18 --interactive --tty ubuntu:18.04
```
* --name: set the name of container run
* --interactive --tty: tty/vm mode
* ubuntu:18.04: name of image (has been pulled)

## Remove Docker image

```
docker rmi ubuntu:18.04
```

## Remove Docker container

```
docker rm <container-name>
```

* To get \<container-name\>, use `docker ps -a` command