Can't run iex into my app inside container

I tried to run my phoenix app into docker container, it worked fine, but I could not use the interactive mode:

iex -S mix.phoenix.server

Here is what I get:

root@97bef7579d61:/usr/src# iex -S mix.phoenix.server
Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]

-S : Could not find executable mix.phoenix.server

However, I can run iex without my app, Any idea?

You should separate mix from rest of params (no dot after mix). Like this…

iex -S mix phoenix.server
# or for version 1.3 of Phoenix
iex -S mix phx.server

Thank you

Also worth mentioning is that if you are using a container system like Dokku, you can run the app commands by doing something like dokku run <your project name> <your command>, so dokku run mix ecto.migrate for example

1 Like