---
# System prepended metadata

title: Self-check Questions lab 2

---

# Self-check Questions lab 2

### 1. Is this statement correct: You can’t create multiple containers from the same image?
No.

### 2. Is this statement correct: All containers running on a single machine share the same operating system kernel, so they start instantly and make more efficient use of RAM.
Yes.

### 3. Is this statement correct: Containers include the application and all of its dependencies, but share the kernel with other containers. They run as an isolated process in userspace on the host operating system. They’re also not tied to any specific infrastructure – Docker containers run on any computer, on any infrastructure, and in any cloud.

Yes.

### 4. Fill in a blank: ________ is a cloud-hosted service from Docker that provides registry capabilities for public and private content

DockerHub

### 5. Fill in a blank: ________ is a tool for defining and running multi-container Docker applications.

Compose.

### 6. Fill in a blank: ________ is native clustering for Docker. It turns a pool of Docker hosts into a single, virtual Docker host.

Swarm.

### 7. Fill in a blank: ________ is a text document that contains all the commands a user could call on the command line to assemble an image

Dockerfile.

### 8. Explain Docker command: `docker exec -it container_id bash`

This will create a new Bash session in the container container_id with input/output in the standard terminal.


### 9. Explain Docker command: `docker build -t myuser/reponame:1.0` (probably should contain `.` at the end of the command)

This command builds an image from a Dockerfile in a current directory and assigns the repo name `myuser/reponame` with the tag `1.0`


### 10. Explain Docker command: `docker commit -m "My first update" container_ID user_name/repository_name`

Commits the changes into a container images on a local repository

### 11. Explain Docker command: `docker push user_name/repository_name`

Pushes the commited changes into the given DockerHub repository. 

### 12. Explain Docker command: `docker ps`
Shows a list of your running containers

### 13. Explain Docker command: `docker images`
Shows a list of images installed on your local computer

### 14. Explain Docker command: `docker ps -a`
Shows the list of all existing (both running and exited) containers on a given machine

### 15. Which command runs a Docker container?
```
docker run NAME
```
### 16. Which command stops Docker a container?

```
docker stop NAME
```

### 17. Which command deletes a Docker container?
```
docker rm NAME
```

### 18. Which command deletes a Docker image?
```
docker rmi NAME
```