-1

I have a problem running an executable in my Dockerfile. It contains a command to download the 'gsoap' library from an internal service, then the following:

ENV PATH="/opt/tools/gsoap/v2.7.12/lnx_x64/bin:${PATH}"
RUN ls -la /opt/tools/gsoap/v2.7.12/lnx_x64/bin
RUN whereis soapcpp2
RUN ["soapcpp2", "-v"]

The ls command returns a result:

drwxr-xr-x 2 root root    4096 Mar  1 17:34 .
drwxr-xr-x 1 root root    4096 Mar  1 17:34 ..
-rwxr-xr-x 1 root root  610652 Mar  1 17:34 soapcpp2
-rwxr-xr-x 1 root root 4270809 Mar  1 17:34 wsdl2h

And whereis is happy too:

soapcpp2: /opt/tools/gsoap/v2.7.12/lnx_x64/bin/soapcpp2

But trying to run it gives:

standard_init_linux.go:195: exec user process caused "no such file or directory"

Whats going on here?

If I change to use the shell form:

RUN soapcpp2 -v

I get

/bin/sh: 1: soapcpp2: not found

Huh? whereis just told me its happy that soapcpp2 is on the PATH.

jramm
  • 6,415
  • 4
  • 34
  • 73

1 Answers1

-1

You need to copy your files in your Dockerfile, using either

ADD

or

COPY

https://docs.docker.com/engine/reference/builder/#add

and

https://docs.docker.com/engine/reference/builder/#copy

By the way, you seem to misuse RUN, maybe your last command should be either

a

CMD

or

ENTRYPOINT

https://docs.docker.com/engine/reference/builder/#cmd

https://docs.docker.com/engine/reference/builder/#entrypoint

See also

What is the difference between CMD and ENTRYPOINT in a Dockerfile?

user2915097
  • 30,758
  • 6
  • 57
  • 59