# Build Imágenes desde docker-compose

Se pueden crear imágenes desde un `docker-compose.yml` .

```
verison: '3'
services:
  web:
    container_name: web
    image: web-test
    build:  .
```

Cuando tenemos un nombre de Dockerfile personalizado ...

```
verison: '3'
services:
  web:
    container_name: web
    image: web-test
    build:
      context: .
      dockerfile: Dockerfile_name1
```

Donde `Dockerfile_name` sería el nombre de nuestro dockerfile. Y en `context` definimos la ruta con el `.` indica en el mismo directorio.

## Ejecutar docker-compose.yml con un build

```
docker-compose build
```


---

# 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://did-web.gitbook.io/notas-docker/docker-compose/build-imagenes-desde-docker-compose.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.
