docker - 在构建步骤中使用参数的 Docker GitHub 操作
问题描述
我正在寻找是否可以从带有 args 的 Dockerfile 构建一个 docker 容器。
目的是在 Dockerfile 中有一个动态的“FROM”。所以在 中FROM circleci/android:api-28
,api-28
是一个参数
因此,对于给定的 Dockerfile 常量:
FROM circleci/android:api-28
COPY entrypoint.sh /entrypoint.sh
RUN sudo chmod +x entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
Github 操作构建以下图像:
Build Diolor/Android-build-action@master2m 8s
Successfully tagged 2e4e3a:89928963f88542989ff9d771e524d2d6
Build container for action use: '/home/runner/work/_actions/Diolor/Android-build-action/master/Dockerfile'.
/usr/bin/docker build -t 2e4e3a:89928963f88542989ff9d771e524d2d6 "/home/runner/work/_actions/Diolor/Android-build-action/master"
Github Actions 是否允许该构建步骤中的环境参数或 arg 参数?
目标是 Action 消费者可以根据需要使用不同的 docker 容器标签。
解决方案
由于我的声誉,我无法评论提问,但我会尽力回答。
我不知道您的工作流程,但如果我理解得很好,您可以使用 args 关键字和类似的入口点:
steps:
- name: It does something
uses: circleci/android:api-28
with:
entrypoint: /entrypoint.sh
args: |
COPY entrypoint.sh /entrypoint.sh
RUN sudo chmod +x entrypoint.sh
我真的不知道它是否会这样工作,但也许这个文档可以帮助你。
推荐阅读
- c# - 如何在 C# 上将 pdf 数字签名到单独的文件中?
- kubernetes - 使用 Prometheus 的平均请求持续时间
- google-chrome - 如何在python中使用autoit单击某些文本或坐标
- google-tag-manager - 谷歌标签管理器阻止 Turbolinks 工作
- c++ - 使用 CMake 构建 ffplay
- r - 遍历文件,划分两个变量并提取结果,包括使用原始文件名称的标识符列
- sql-server - 如何使用存储过程将一行数据添加到一个表,将多行数据添加到另一个表-Microsoft SQL Server Management Studio
- git - git reset --hard 在新的 repo 上暂存后
- python - 有没有办法访问通过python连接到PC的手机中的文件?
- tiddlywiki - 如何制作与其他提琴手的缩略链接?