Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
240 views
in Technique[技术] by (71.8m points)

Could not access a running Docker Image of War (with tomcat) in minishift - OpenShift-Origin

I have crated a docker image for a simple Java-Spring MVC War file, (Docker Config below). I am able to run the using docker run command and also I do not see any errors in the log or trouble uploading war into internal registry in Openshift-minishift. I was able to pull the image in my Openshift-minishift console.

#Docker Config

FROM tomcat:8.0.20-jre8

MAINTAINER ashok.gudise@github

ENV CATALINA_HOME /usr/local/tomcat
ENV PATH $CATALINA_HOME/bin:$PATH

RUN mkdir -p "$CATALINA_HOME"

WORKDIR $CATALINA_HOME

RUN chgrp -R 0 $CATALINA_HOME
RUN chmod -R g+rw $CATALINA_HOME
RUN find $CATALINA_HOME -type d -exec chmod g+x {} +

#RUN mkdir $CATALINA_HOME/app_conf
#ADD config $CATALINA_HOME/app_conf/

COPY build/libs/distributed-app-1.0.war $CATALINA_HOME/webapps/

#RUN sed -i -e 's/^shared.loader=$/shared.loader="${catalina.base}/app_conf"/' $CATALINA_HOME/conf/catalina.properties

EXPOSE 8080

CMD ["catalina.sh", "run"]

-- OC Commands

oc new-project ext-project
oc login -u admin 
oc policy add-role-to-user admin ashokgudise ext-project
oc adm policy add-scc-to-group anyuid system:authenticated
oc policy add-role-to-group system:image-puller system:serviceaccounts:extproject
docker login -u ashokgudise -p XXXXXXXX 111.11.111.11:5000

docker push 111.11.111.11:5000/ext-project/dock-img-app:latest
docker tag dist-app:1.0 111.11.111.11:5000/ext-project/dock-img-app:latest

I do not see any unusual thing or exceptions in my pod's tomcat logs,also I can see exploded war in the pod's terminal.

exploded war

I could not able to run the app with generated route,

enter image description here

enter image description here

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Finally I have resolved my issue, I've seen similar kind of issue that I faced here https://github.com/openshift/origin/issues/8702 .

Reason could be missing haproxy config for my generated router.

So I have uninstalled my minishift, and re-installed minishift using ansible-container

Now tomcat is up and running!!!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...