# Pass Build Time Arguments To Docker Build

While building Dockerfile(s) we can pass and use Environment variables such as -

```dockerfile
ARG VARIABLE1
ARG VARIABLE2

RUN echo "Value of first Variable = ${VARIABLE1}" && \
    echo "Value of second Variable = ${VARIABLE2}"
```

And running `docker build` command as following -

```bash
docker build -t {IMAGE_NAME}:{IMAGE_TAG} \
                --build-arg {VARIABLE1}="Some value" \
                --build-arg {VARIABLE2}="Some other value"
```

***Source:*** [***Bits and Picces***](https://blog.bitsrc.io/how-to-pass-environment-info-during-docker-builds-1f7c5566dd0e)


---

# 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://til.devjugal.com/docker/pass-build-time-arguments-to-docker-build.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.
