【发布时间】:2020-07-01 07:57:11
【问题描述】:
我想在 Dockerfile.app 中创建环境变量,Sentry 将使用它来对我的构建进行版本控制
这是我在该文件中的内容:
ENV REACT_APP_RELEASE_VERSION=$(git rev-parse --short HEAD)-$(date -u '+%Y-%m-%dT%H:%M:%SZ')
它在 bash 中工作正常:
REACT_APP_RELEASE_VERSION=2a06954-2020-07-01T07:41:49Z
但是在管道构建我的项目时,它会抛出错误:
Error response from daemon: failed to parse Dockerfile.app: Syntax error - can't find = in "rev-parse". Must be of the form: name=value
有什么想法吗?
【问题讨论】: