reuse timestamp, don't call time.Now() 3 times

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Merge pull request #6127 from unclejack/reuse_timestamp

reuse timestamp, don't call time.Now() 3 times