【问题标题】:Can I use skaffold build with source code that contians docker file我可以将 skaffold 构建与包含 dockerfile 的源代码一起使用吗
【发布时间】:2021-12-30 13:21:15
【问题描述】:

需要克隆一些 repo 说:git clone abc.git 然后将上下文切换到 abc 然后使用 abc 中的 dockerfile 使用通过自定义 ARGS 的 skaffold 进行构建。

是否可以通过 skaffold 实现这一目标

例如:

    - name: test-build
      build:
        tagPolicy:
          envTemplate:
            template: 1.0.0
        artifacts:
        - image: dockerhub.io/test-build
          requires:
            command: ["git", "clone", "abc.git"]
          context: ./abc

【问题讨论】:

  • 我不知道 skaffold 但 docker 本身可以在 url / git repos 上操作。你也许可以直接使用 repo docs.docker.com/engine/reference/commandline/build/…
  • 这有帮助,我可以使用这个和 skaffold 自定义构建命令仍然通过 skaffold 构建并且不需要显式克隆

标签: docker skaffold


【解决方案1】:

这是使用 skaffold 自定义构建对我有用的一种方法

- name: test-build
 build:
    tagPolicy:
      envTemplate:
        template: 1.0.0
    artifacts:
    - image: dockerhub.io/test-build
       custom:
          buildCommand: docker build github.com/abc.git#v1

【讨论】:

    猜你喜欢
    • 2015-03-20
    • 1970-01-01
    • 2013-10-04
    • 1970-01-01
    • 2018-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-19
    相关资源
    最近更新 更多