So the pattern you probably want to follow is the one described here: https://docs.openshift.org/latest/dev_guide/builds.html#using-external-artifacts
by setting the ENTRYPOINT i mean your Dockerfile needs to contain something like: ENTRYPOINT /usr/libexec/s2i/run so that when the image starts up, it launches the application. (I am assuming /usr/libexec/s2i/run exists in the image you are using, if not, you need to set your ENTRYPOINT to some script that is going to properly start up the application framework in your container) It will be up to your Dockerfile to ADD your .war file to the correct location so that tomcat finds it when it is started. On Thu, Mar 10, 2016 at 3:00 AM, Srinivas Naga Kotaru (skotaru) < [email protected]> wrote: > That might work, but need to test. Can u explain what do you mean by s2i > ENTRYPOINT in this scanario? > > Documentation says we can insert war file like mentioned below > > https://docs.openshift.org/latest/dev_guide/builds.html#binary-source > > Not sure why it is not working … > > > -- > *Srinivas Kotaru* > > From: Ben Parees <[email protected]> > Date: Wednesday, March 9, 2016 at 11:43 PM > To: skotaru <[email protected]> > Cc: "[email protected]" <[email protected]>, " > [email protected]" <[email protected]> > Subject: Re: binary deploy > > I think you could use a docker-type build with an inline dockerfile that > ADDs the remote file: > > https://docs.openshift.org/latest/dev_guide/builds.html#dockerfile-source > > you can use the same base image, just have your dockerfile FROM the base > image, ADD the war to the correct location inside the image, and set the > ENTRYPOINT to the s2i run script. > > > On Wed, Mar 9, 2016 at 11:59 PM, Srinivas Naga Kotaru (skotaru) < > [email protected]> wrote: > >> Clayton >> >> What you described already working if I pass using start-build. >> >> I am trying to pass one sample.war as a argument to template and use this >> to create initial application. Think about this is sample hello world >> program as part of provision. Once app was provisioned, app teams can >> deploy the way you described. >> >> If I put empty string to asFile, app creation is successful but build is >> waiting forever. So if clients hit browser, they wont get any output and >> might get confuse. >> >> Am sure we can pass git repo by adjusting strategy but exploring if >> possible to use a sample.war as argument to template >> >> >> >> -- >> Srinivas Kotaru >> >> >> >> >> >> >> On 3/9/16, 8:49 PM, "Clayton Coleman" <[email protected]> wrote: >> >> >The container itself is what determines whether the image will be used >> >and what directory is it expecting to see WARs in >> > >> >I *think* you need to do >> > >> >$ mkdir deployments >> >$ mv .../sample.war deployments/ >> >$ oc start-build --from-dir=. >> > >> >Binary builds require you to launch start-build --from-X, otherwise >> >the build will wait forever for you to send it the binary. >> > >> > >> > >> > >> >On Wed, Mar 9, 2016 at 11:04 PM, Srinivas Naga Kotaru (skotaru) >> ><[email protected]> wrote: >> >> I think that is pretty desired feature. I can think multiple use >> cases, one could by taking final artifacts from Jenkins builds. >> >> >> >> BTY, am still having issues. Am creating an application using >> template. This time I mentioned sample.war and copied sample.war file to >> folder where am running oc. Also copied same file to templates folder where >> my template exist. In either cases build is failing >> >> >> >> "spec": { >> >> "source": { >> >> "type": "Binary", >> >> "binary": { >> >> "asFile": "sample.war" >> >> }, >> >> "contextDir": "${CONTEXT_DIR}" >> >> >> >> >> >> >> >> # oc logs sales-dev-1-build >> master ✗ ✭ ✱ >> >> >> >> I0309 22:58:52.610618 1 sti.go:173] The value of ALLOWED_UIDS is >> [1-] >> >> I0309 22:58:52.642387 1 docker.go:242] Pulling Docker image >> registry.access.redhat.com/jboss-eap-6/eap64-openshift:1.2 ... >> >> I0309 22:58:59.932801 1 sti.go:195] Creating a new S2I builder >> with build config: "Builder Name:\t\tJBoss EAP 6.4\nBuilder Image:\t\ >> tregistry.access.redhat.com/jboss-eap-6/eap64-openshift:1.2\nSource >> <http://tregistry.access.redhat.com/jboss-eap-6/eap64-openshift:1.2%5CnSource> >> :\t\t\tfile:///tmp/s2i-build632502898/upload/src\nContext >> Directory:\t/Users/skotaru/lae3/build/ose-binary-builds\nOutput Image >> Tag:\t172.30.238.173:5000/sales/sales-dev:latest\nEnvironment:\t\tOPENSHIFT_BUILD_NAME=sales-dev-1,OPENSHIFT_BUILD_NAMESPACE=sales\nIncremental >> Build:\tdisabled\nRemove Old Build:\tdisabled\nBuilder Pull >> Policy:\talways\nQuiet:\t\t\tdisabled\nLayered >> Build:\t\tdisabled\nWorkdir:\t\t/tmp/s2i-build632502898\nDocker >> NetworkMode:\tcontainer:05752cac5dbdce4a5f77d60ed23030dda17a9344aa904ec3c9786e231a858233\nDocker >> Endpoint:\tunix:///var/run/docker.sock\n" >> >> I0309 22:58:59.932858 1 docker.go:242] Pulling Docker image >> registry.access.redhat.com/jboss-eap-6/eap64-openshift:1.2 ... >> >> I0309 22:59:01.449811 1 sti.go:140] Preparing to build >> 172.30.238.173:5000/sales/sales-dev:latest >> >> I0309 22:59:01.453593 1 source.go:151] Receiving source from >> STDIN as file sample.war >> >> [ose-binary-builds] >> master ✗ ✭ ✱ >> >> [ose-binary-builds] >> master ✗ ✭ ✱ >> >> [ose-binary-builds] oc logs sales-dev-1-build -f >> master ✗ ✭ ✱ >> >> I0309 22:58:52.610618 1 sti.go:173] The value of ALLOWED_UIDS is >> [1-] >> >> I0309 22:58:52.642387 1 docker.go:242] Pulling Docker image >> registry.access.redhat.com/jboss-eap-6/eap64-openshift:1.2 ... >> >> I0309 22:58:59.932801 1 sti.go:195] Creating a new S2I builder >> with build config: "Builder Name:\t\tJBoss EAP 6.4\nBuilder Image:\t\ >> tregistry.access.redhat.com/jboss-eap-6/eap64-openshift:1.2\nSource >> <http://tregistry.access.redhat.com/jboss-eap-6/eap64-openshift:1.2%5CnSource> >> :\t\t\tfile:///tmp/s2i-build632502898/upload/src\nContext >> Directory:\t/Users/skotaru/lae3/build/ose-binary-builds\nOutput Image >> Tag:\t172.30.238.173:5000/sales/sales-dev:latest\nEnvironment:\t\tOPENSHIFT_BUILD_NAME=sales-dev-1,OPENSHIFT_BUILD_NAMESPACE=sales\nIncremental >> Build:\tdisabled\nRemove Old Build:\tdisabled\nBuilder Pull >> Policy:\talways\nQuiet:\t\t\tdisabled\nLayered >> Build:\t\tdisabled\nWorkdir:\t\t/tmp/s2i-build632502898\nDocker >> NetworkMode:\tcontainer:05752cac5dbdce4a5f77d60ed23030dda17a9344aa904ec3c9786e231a858233\nDocker >> Endpoint:\tunix:///var/run/docker.sock\n" >> >> I0309 22:58:59.932858 1 docker.go:242] Pulling Docker image >> registry.access.redhat.com/jboss-eap-6/eap64-openshift:1.2 ... >> >> I0309 22:59:01.449811 1 sti.go:140] Preparing to build >> 172.30.238.173:5000/sales/sales-dev:latest >> >> I0309 22:59:01.453593 1 source.go:151] Receiving source from >> STDIN as file sample.war >> >> >> >> >> >> >> >> I think build is still expecting sample.war file from STDIN >> >> >> >> >> >> -- >> >> Srinivas Kotaru >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> On 3/9/16, 7:55 PM, "Clayton Coleman" <[email protected]> wrote: >> >> >> >>>No, binaries are passed directly to the build, we don't support >> >>>download from URL as a build source yet. >> >>> >> >>>On Wed, Mar 9, 2016 at 10:35 PM, Srinivas Naga Kotaru (skotaru) >> >>><[email protected]> wrote: >> >>>> Can we pass FQDN to fetch WAR file like below? >> >>>> >> >>>> "spec": { >> >>>> "source": { >> >>>> "type": "Binary", >> >>>> "binary": { >> >>>> "asFile": >> >>>> "https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war" >> >>>> }, >> >>>> "contextDir": "${CONTEXT_DIR}” >> >>>> >> >>>> >> >>>> When I try it is failing … >> >>>> >> >>>> spec.source.binary.asFile: invalid value >> >>>> 'https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war', >> >>>> Details: file name may not contain slashes or relative path segments >> and >> >>>> must be a valid POSIX filename >> >>>> >> >>>> -- >> >>>> Srinivas Kotaru >> >>>> >> >>>> _______________________________________________ >> >>>> users mailing list >> >>>> [email protected] >> >>>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users >> >>>> >> >> _______________________________________________ >> users mailing list >> [email protected] >> http://lists.openshift.redhat.com/openshiftmm/listinfo/users >> > > > > -- > Ben Parees | OpenShift > > -- Ben Parees | OpenShift
_______________________________________________ users mailing list [email protected] http://lists.openshift.redhat.com/openshiftmm/listinfo/users
