2

I have the following situation. I created a build in OpenShift:

oc new-build --strategy docker --binary --docker-image centos:centos7 --name myapp

And locally there is nothing fancy. I have a .war file and Dockerfile:

FROM registry.access.redhat.com/jboss-webserver-3/webserver31-tomcat7-openshift

COPY pdf-maker##1.2.war /opt/webserver/webapps/
COPY pdfmaker1.0.properties /opt/webserver/conf/

COPY fop.xconf /opt/webserver/_fop/conf/fop.xconf
COPY logo.gif /opt/webserver/_fop/img/
COPY PDF_Transformation.xslt /opt/webserver/_fop/transformation/

RUN mkdir -p /opt/webserver/fop

WORKDIR /opt/webserver

EXPOSE 8080

CMD ["/opt/webserver/bin/catalina.sh", "run"]

And I run the build like:

oc start-build myapp --from-dir . --follow

So far so good... but the application never starts in OpenShift. It says that: "Error: failed to start container "myapp": Error response from daemon: oci runtime error: container_linux.go:235: starting container process caused "exec: \"/opt/webserver/bin/catalina.sh\": stat /opt/webserver/bin/catalina.sh: no such file or directory" I tried to skip the CMD line but with no success. I am 100% the path is correct.

I have tried to build the Docker image from the Dockerfile locally and start it. Locally works as expected but in OpenShift - does not work. I am doing something wrong but I don't know what.

I would much appreciate if someone points me the problem.

SOLVED

It turned out I was relying on centos which was the culprit. The solution was to to use this:

oc new-build --strategy docker --binary --docker-image registry.access.redhat.com/jboss-webserver-3/webserver31-tomcat7-openshift --name sinergia-pdf-maker
dnmitev
  • 71
  • 10

0 Answers0