We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
构建镜像时通过 git rev-parse --short HEAD 获取到 commit hash 然后作为镜像环境变量 $git_commit。
git rev-parse --short HEAD
$git_commit
镜像构建命令:
docker build --build-arg git_commit=$(git rev-parse --short HEAD)
Dockerfile:
ARG git_commit=0 ENV git_commit=$git_commit
The text was updated successfully, but these errors were encountered:
96400c0
88250
No branches or pull requests
构建镜像时通过
git rev-parse --short HEAD
获取到 commit hash 然后作为镜像环境变量$git_commit
。镜像构建命令:
Dockerfile:
The text was updated successfully, but these errors were encountered: