-2

I have encountered an interesting issue with a custom image created with dockerfile in windows. Dockerfile as follows;

FROM alpine

COPY ./exe /program/exe
COPY ./ConfigFile.txt /program/ConfigFile.txt

ENTRYPOINT /program/exe /program/ConfigFile.txt

Executable accepts a config file as its first parameter.

It is complaining that the executable is missing. But when I change the entrypoint to /bin/sh and list directory items, they are clearly there with appropriate execution rights.

The output is:

/program # ls -la
total 6356
drwxr-xr-x    1 root     root          4096 Aug  4 15:42 .
drwxr-xr-x    1 root     root          4096 Aug  4 15:39 ..
-rwxr-xr-x    1 root     root           191 Jul 31 07:45 ConfigFile.txt
-rwxr-xr-x    1 root     root       6490496 Jun  1 12:58 exe
/program # ./exe ./ConfigFile.txt
/bin/sh: ./exe: not found

I have tried changing the line ending in the dockerfile to LF or CRLF and neither of which have help

What am I missing?!

Edit: By the way, cat exe works and spits the binary encoded text to console output, which also confirms it is right there!

FFaFafy
  • 27
  • 5
  • https://stackoverflow.com/questions/69607005/cannot-run-executables-with-alpine-and-busybox-docker-images https://stackoverflow.com/questions/68636358/file-not-found-in-alpine-container-despite-existing https://stackoverflow.com/questions/43209656/cannot-run-jfrog-executable-from-inside-alpine-linux-container https://stackoverflow.com/questions/67672392/docker-image-with-alpine-linux-an-executable-file-is-definitely-there-but-canno – KamilCuk Aug 04 '23 at 16:42
  • I would guess that `exe` is a Windows executable based on the name. You're copying it into a Linux image and that can't run Windows programs. – Hans Kilian Aug 04 '23 at 19:09
  • Apparently, libgcc and libc++ should be installed to run the executable. I did not think alpine would be so bare that it could not even run c++ executable – FFaFafy Aug 06 '23 at 12:49

0 Answers0