Suggest an editImprove this articleRefine the answer for “How to set the name and tag of the image being built?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)The name and tag of a **Docker image** are set with the `-t` (or `--tag`) flag in the `docker build` command. **Key point:** the name and tag are set with the `-t` flag in `docker build`, in the `name:tag` format.Shown above the full answer for quick recall.Answer (EN)ImageThe name and tag of a Docker image are set with the `-t` (or `--tag`) flag in the `docker build` command. --- ### **Syntax** ```bash docker build -t NAME:TAG . ``` --- ### **Example** ```bash docker build -t myapp:1.0 . ``` Where: | Part | Meaning | |---|---| | `myapp` | image name | | `1.0` | tag (version) | | `.` | build context (current directory) | --- ### **Details** - If no tag is given, Docker assigns `latest`: ```bash docker build -t myapp . ``` → this becomes `myapp:latest` - A tag can contain words, digits, environment names: ```javascript myapp:dev myapp:prod myapp:v2 ``` --- ### **Summary** > The name and tag are set with the `-t` flag in `docker build`, in the `name:tag` format.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.