{"action":"created","issue":{"url":"https://api.github.com/repos/openshift/source-to-image/issues/305","labels_url":"https://api.github.com/repos/openshift/source-to-image/issues/305/labels{/name}","comments_url":"https://api.github.com/repos/openshift/source-to-image/issues/305/comments","events_url":"https://api.github.com/repos/openshift/source-to-image/issues/305/events","html_url":"https://github.com/openshift/source-to-image/pull/305","id":110641359,"number":305,"title":"WIP: Add docker:// source strategy","user":{"login":"mfojtik","id":44136,"avatar_url":"https://avatars.githubusercontent.com/u/44136?v=3","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-09T11:44:48Z","updated_at":"2015-10-09T11:48:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openshift/source-to-image/pulls/305","html_url":"https://github.com/openshift/source-to-image/pull/305","diff_url":"https://github.com/openshift/source-to-image/pull/305.diff","patch_url":"https://github.com/openshift/source-to-image/pull/305.patch"},"body":"This will allow to specify the source location that points into a directory inside Docker image. For example:\r\n\r\n```console\r\n$ s2i build docker://sample-app-sources:/sample-app openshift/ruby-20-centos7 final-app\r\n```\r\n\r\nIn this case, we will pull (or not pull as force-pull applies here) the `sample-app-sources` Docker image, then run it and stream the `/sample-app` directory using `tar`. Once we have this directory locally, we just set the source location to \"file://local-folder\" and execute the regular S2I build.\r\n\r\nThe output looks like this (in this example the `sample-app-sources` is just a busybox image with sources ADD to `/sample-app`:\r\n\r\n```console\r\nI1009 13:39:31.884721 28057 util.go:31] Getting docker credentials for openshift/ruby-20-centos7\r\nI1009 13:39:31.884855 28057 util.go:43] Using mi@mifo.sk credentials for pulling openshift/ruby-20-centos7\r\nI1009 13:39:31.890272 28057 docker.go:214] Image openshift/ruby-20-centos7:latest available locally\r\n\r\nBuilder Name:\t\tRuby 2.0\r\nBuilder Image:\t\topenshift/ruby-20-centos7\r\nBuilder Image Version:\t004e164\r\nBuilder Base Version:\t71a650e\r\nSource:\t\t\tdocker://sample-app-sources:/sample-app\r\nOutput Image Tag:\tfinal-app\r\nIncremental Build:\tdisabled\r\nRemove Old Build:\tdisabled\r\nForce Pull:\t\tdisabled\r\nQuiet:\t\t\tdisabled\r\nLayered Build:\t\tdisabled\r\nDocker Endpoint:\tunix:///var/run/docker.sock\r\nDocker Pull Config:\t/root/.docker/config.json\r\nDocker Pull User:\tmfojtik\r\n\r\nI1009 13:39:31.891933 28057 docker.go:214] Image openshift/ruby-20-centos7:latest available locally\r\nI1009 13:39:31.892988 28057 sti.go:128] Preparing to build final-app\r\nI1009 13:39:31.893852 28057 docker.go:214] Image sample-app-sources:latest available locally\r\nI1009 13:39:31.893872 28057 copy.go:47] Downloading sources from \"sample-app-sources\" to \"/tmp/sti594925303/upload/sources\"\r\nW1009 13:39:31.894670 28057 docker.go:329] Image does not contain a value for the io.openshift.s2i.scripts-url label\r\nI1009 13:39:31.894694 28057 docker.go:384] Base directory for STI scripts is ''. Untarring destination is '/tmp'.\r\nI1009 13:39:31.894703 28057 docker.go:515] Creating container using config: {Hostname: Domainname: User: Memory:0 MemorySwap:0 CPUShares:0 CPUSet: AttachStdin:false AttachStdout:true AttachStderr:false PortSpecs:[] ExposedPorts:map[] Tty:false OpenStdin:false StdinOnce:false Env:[] Cmd:[tar cf - /sample-app] DNS:[] Image:sample-app-sources:latest Volumes:map[] VolumesFrom: WorkingDir: MacAddress: Entrypoint:[] NetworkDisabled:false SecurityOpts:[] OnBuild:[] Mounts:[] Labels:map[]}\r\nI1009 13:39:32.197016 28057 docker.go:526] Attaching to container\r\nI1009 13:39:32.198151 28057 docker.go:532] Starting container\r\nE1009 13:39:32.318124 28057 util.go:85] tar: removing leading '/' from member names\r\n\r\n... some noisy tar output ...\r\n\r\nI1009 13:39:33.314178 28057 docker.go:331] Image contains io.openshift.s2i.scripts-url set to 'image:///usr/libexec/s2i'\r\nI1009 13:39:33.314194 28057 docker.go:384] Base directory for STI scripts is '/usr/libexec/s2i'. Untarring destination is '/tmp'.\r\nI1009 13:39:33.314202 28057 docker.go:515] Creating container using config: {Hostname: Domainname: User: Memory:0 MemorySwap:0 CPUShares:0 CPUSet: AttachStdin:false AttachStdout:true AttachStderr:false PortSpecs:[] ExposedPorts:map[] Tty:false OpenStdin:true StdinOnce:true Env:[] Cmd:[/bin/sh -c tar -C /tmp -xf - && /usr/libexec/s2i/assemble] DNS:[] Image:openshift/ruby-20-centos7:latest Volumes:map[] VolumesFrom: WorkingDir: MacAddress: Entrypoint:[] NetworkDisabled:false SecurityOpts:[] OnBuild:[] Mounts:[] Labels:map[]}\r\nI1009 13:39:33.649982 28057 docker.go:526] Attaching to container\r\nI1009 13:39:33.650717 28057 docker.go:532] Starting container\r\nI1009 13:39:33.803550 28057 docker.go:462] Waiting for container\r\nI1009 13:39:33.847278 28057 sti.go:430] ---> Installing application source ...\r\nI1009 13:39:33.850295 28057 sti.go:430] ---> Building your Ruby application from source ...\r\nI1009 13:39:33.965133 28057 sti.go:430] WARNING: Rubygem Rack is not installed in the present image.\r\nI1009 13:39:33.965158 28057 sti.go:430]          Add rack to your Gemfile in order to start the web server.\r\nI1009 13:39:34.185579 28057 docker.go:464] Container wait returns with 0 and <nil>\r\nI1009 13:39:34.185600 28057 docker.go:471] Container exited\r\nI1009 13:39:34.185603 28057 docker.go:554] Invoking postExecution function\r\nI1009 13:39:34.185711 28057 sti.go:252] No .sti/environment provided (no environment file found in application sources)\r\nI1009 13:39:34.187576 28057 docker.go:588] Committing container with config: {Hostname: Domainname: User: Memory:0 MemorySwap:0 CPUShares:0 CPUSet: AttachStdin:false AttachStdout:false AttachStderr:false PortSpecs:[] ExposedPorts:map[] Tty:false OpenStdin:false StdinOnce:false Env:[] Cmd:[/usr/libexec/s2i/run] DNS:[] Image: Volumes:map[] VolumesFrom: WorkingDir: MacAddress: Entrypoint:[] NetworkDisabled:false SecurityOpts:[] OnBuild:[] Mounts:[] Labels:map[io.openshift.builder-version:004e164 io.openshift.expose-services:8080:http License:GPLv2 io.openshift.builder-base-version:71a650e io.openshift.s2i.scripts-url:image:///usr/libexec/s2i Vendor:CentOS io.k8s.display-name:final-app io.openshift.s2i.build.image:openshift/ruby-20-centos7 io.openshift.s2i.build.source-location:/tmp/sti594925303/upload/sources io.openshift.tags:builder,ruby,ruby20 io.s2i.scripts-url:image:///usr/libexec/s2i io.k8s.description:Platform for building and running Ruby 2.0 applications]}\r\nI1009 13:39:35.562074 28057 sti.go:288] Successfully built final-app\r\nI1009 13:39:36.485138 28057 cleanup.go:23] Removing temporary directory /tmp/sti594925303\r\nI1009 13:39:36.485160 28057 fs.go:99] Removing directory '/tmp/sti594925303'\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/openshift/source-to-image/issues/comments/146841623","html_url":"https://github.com/openshift/source-to-image/pull/305#issuecomment-146841623","issue_url":"https://api.github.com/repos/openshift/source-to-image/issues/305","id":146841623,"user":{"login":"openshift-bot","id":1779249,"avatar_url":"https://avatars.githubusercontent.com/u/1779249?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift-bot","html_url":"https://github.com/openshift-bot","followers_url":"https://api.github.com/users/openshift-bot/followers","following_url":"https://api.github.com/users/openshift-bot/following{/other_user}","gists_url":"https://api.github.com/users/openshift-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift-bot/subscriptions","organizations_url":"https://api.github.com/users/openshift-bot/orgs","repos_url":"https://api.github.com/users/openshift-bot/repos","events_url":"https://api.github.com/users/openshift-bot/events{/privacy}","received_events_url":"https://api.github.com/users/openshift-bot/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T11:48:54Z","updated_at":"2015-10-09T11:48:54Z","body":"Evaluated for source to image test up to b3803f63dd76adf38a875a2cae4feb2d646f2f8b"}}