[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Automated build from Git subfolder



Unfortunately setting "contextDir" doesn't seem to work, getting error:

[Jan 12 15:56:55.809] Cloning into '/tmp/docker-build796077794'...
[Jan 12 15:56:59.640] 2015/01/12 15:56:59 Build error: API error (500): Can't build a directory with no Dockerfile

or am I doing something wrong?

Here is my BuildConfig:

      "kind": "BuildConfig",
      "apiVersion": "v1beta1",
      "triggers": [
        {
          "type": "github",
          "github": {
            "secret": "secret101"
          }
        },
        {
          "type": "generic",
          "generic": {
            "secret": "secret101"
          }
        }
      ],
      "parameters": {
        "source" : {
          "type" : "Git",
          "git" : {
            "uri": "git://github.com/zendtech/php-zendserver-docker.git"
          }
        },
        "strategy": {
          "type": "Docker",
        "dockerBuildStrategy": {
          "contextDir": "./8.0/5.6"
         },
        },
 

Thanks for your help!

On Mon, Jan 12, 2015 at 11:45 AM, Dror Gensler <dror g zend com> wrote:
Much obliged! 

On Mon, Jan 12, 2015 at 6:26 AM, Ben Parees <bparees redhat com> wrote:
Yes I believe you can do that today.  You specify the source uri as you have done, in the BuildConfig and then within the DockerBuildStrategy you can specify a subdirectory of that repo for the context:
https://github.com/openshift/origin/blob/master/pkg/build/api/types.go#L173


Ben Parees | OpenShift

----- Original Message -----
> From: "Dror Gensler" <dror g zend com>
> To: users lists openshift redhat com
> Sent: Sunday, January 11, 2015 8:28:37 AM
> Subject: Fwd: Automated build from Git subfolder
>
> Hello,
>
> I'v been experimenting with automated Builds and encountered a problem-
> In a Docker BuildConfig with a Git repo as source a repo URI must be
> specified like so:
> "uri": "git:// github.com/dror-g/some-repo.git "
>
> However, most Docker images source repo's contain multiple sub-directories-
> one for each tag of the built container.
> For example the official MySQL repo -
> https://github.com/docker-library/mysql
>
> Or a more relevant example- Zend's image which supports openshift:
> https://github.com/zendtech/php-zendserver-docker
>
> Is there a way to specify a version-tag subfolder in a BuildConfig?
>
> Thank you,
> Dror Gensler
> Zend Technologies.
>
>
> _______________________________________________
> users mailing list
> users lists openshift redhat com
> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]