0

I have a Dockerfile where I want to run a script called myscript.sh. I move this script to /bin folder and make it executable. But it gives standard_init_linux.go:219: exec user process caused: exec format error when executed via Docker run. Here are the files

Dockerfile

FROM openjdk:8-jdk-alpine
ADD target/entity-linker-1.war entity-linker-1.war
EXPOSE 8080
COPY myscript.sh /bin/myscript.sh
ENV PATH="${PATH}:/bin/myscript.sh"
RUN ["chmod", "+x", "/bin/myscript.sh"]
ENTRYPOINT ["/bin/myscript.sh"]

myscript.sh

echo 'test'
cuneyttyler
  • 1,255
  • 2
  • 17
  • 27
  • 1
    The script file doesn't seem to have a `#!` "shebang" line saying what interpreter needs to be used to run it; does starting the file with `#!/bin/sh` help? – David Maze Aug 09 '21 at 22:27
  • one note: you should "chmod" the file outside of the container and COPY in the file with that already done. will save you some build time and image size on the final image. you also don't need the script in the PATH if you're calling it with a fully qualified path (which you are) – tarfeef101 Aug 09 '21 at 22:30

0 Answers0