Skip to content

bake-hcl: add function to access current time / build time #1201

@tnaroska

Description

@tnaroska

I was looking for a way to access the current time (or build time) in my docker-bake.hcl file but couldn't find an obvious way to do so.
There are some cty stdlib functions that work on timestamps (e.g. timeAdd, formatDate) but no obvious way to get the current time. I would suggest adding a wrapper function for time.Now() or maybe a builtin variable to access the build time.

Environment:

buildx   v0.8.2
buildkit v0.10.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions