Exception while running container

Hi Team,

I am trying to build and run container, build is ok but while running container I m getting exception, below is details.

Dockerfile

FROM centos:centos7.9.2009
RUN yum -y install java-1.8.0-openjdk \ net-tools which \ && yum clean all
RUN mkdir /vxi
WORKDIR /vxi
COPY vxi_1091 /vxi
CMD /vxi_1091/bin/run_vxi_1091.sh

build o/p

[root@imi-hyd-rnd1 docker]# docker build -t vxi .
Sending build context to Docker daemon 87.73MB
Step 1/6 : FROM centos:centos7.9.2009
—> eeb6ee3f44bd
Step 2/6 : RUN yum -y install java-1.8.0-openjdk \ net-tools which \ && yum clean all
—> Using cache
—> daab11a97cca
Step 3/6 : RUN mkdir /vxi
—> Using cache
—> 41f32cba0657
Step 4/6 : WORKDIR /vxi
—> Using cache
—> b2aba0e1ac69
Step 5/6 : COPY vxi_1091 /vxi
—> Using cache
—> b015ea8589cd
Step 6/6 : CMD /vxi_1091/bin/run_vxi_1091.sh
—> Running in b56215edb1f9
Removing intermediate container b56215edb1f9
—> f5409f5d35e3
Successfully built f5409f5d35e3
Successfully tagged vxi:latest

running container

[root@imi-hyd-rnd1 docker]# docker run -it vxi
/bin/sh: /vxi_1091/bin/run_vxi_1091.sh: No such file or directory

I reformatted your post. Please, use the </> button to highlight code blocks. That way we can understand your question more easily.

You use an incorrect path after the CMD instruction. You copied vxi_1091 from the host to /vxi in the container, yet your CMD starts with /vxi_1091. Try this:

CMD /vxi/bin/run_vxi_1091.sh

Thanks now that exception is cleared but while running container getting another exception, same .sh file running manually doesn’t give any exception.

docker run -it vxi
debug -classpath : //config://lib/*://lib/deps/*://lib/deps/3rd-party/*://lib/deps/3rd-party/log4j2/*://lib/deps/3rd-party/http/4.5.13/*://lib/deps/3rd-party/net-snmp/*://lib/deps/3rd-party/rhino-1.7R2/*://lib/deps/3rd-party/springframework/*://lib/deps/mongo-util/*

Hi Rimelek,

Did you get time to check over exception? think i needs to define environment variable in docker file w.r.t to exception i m getting while running container, not sure, kindly feedback.

No, I wasn’t around much in the past few days.

What is the “exception”? Do you mean that “debug -classpath” line? I don’t know what that line means.

I would like to ask you again to use the </> button to higlight your code. Without it the could will be interpreted by the MarkDown formatter and it changes how your error messages are shown. I edited your post again.