# Docker

## Docker Commands

Command to inspect the content of an image created

```bash
docker run -it --name temp_container imageName /bin/sh
```

where "temp\_container" is the name of temporary container

```bash
docker images
```

to list images

```
docker build -t server .
```

to build images where "server' is the name of image

```bash
docker run --rm -p 8000:8000 name_of_image
```

Add `--rm` to remove the container after it stops

Command to get ip address of contaier

```sh
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' postgres-local
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gautamnaik1994.gitbook.io/snippets/architecture/docker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
