How to tag an image in a Dockerfile? [duplicate]

Unfortunately it is not possible. You can use build.sh script, which contains like this:

#!/usr/bin/env bash
if [ $# -eq 0 ]
  then
    tag='latest'
  else
    tag=$1
fi

docker build -t project:$tag .

Run ./build.sh for creating image project:latest or run ./build.sh your_tag to specify image tag.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)