0

I am playing around with docker and this simple image

FROM golang:1.13.4-stretch

ENTRYPOINT ["/bin/bash"]

And when I try to run docker build -t test . && docker run -it --rm test "go version" I get the error /bin/bash: go version: No such file or directory

Without the ENTRYPOINT line I have no problem running it.

Also, it doesn't seem to matter which shell I use, as long as the line is there it will always fail.

Could anyone enlighten me does it behave like this?

FYI: The value of PATH inside the container when using the ENTRYPOINT doesn't include the /usr/local/go/bin (where the go exec is)

kostix
  • 51,517
  • 14
  • 93
  • 176
Ricardo
  • 3
  • 1

1 Answers1

1

I believe the shell is interpreting "go version" as the command to run instead of the command go with the argument version. Try removing the quotes.

John Moon
  • 924
  • 6
  • 10
  • That did solve my problem, thank you John. I will need to investigate the effect of using quotes and not using them – Ricardo Jun 10 '20 at 22:12