3

I have some script for irc bot and want to run it with docker run -d --name php-fpm php:5 irc_bot.php however it doesn't work. I don't need web server : apach, nginx, but only clli is needed.

Do you know how to simply run php irc_bot.php with online docker command?

2
  • Wrt the only needing php cli, there are cli only versions available, check out the hub page. Commented Apr 27, 2016 at 9:16
  • You mean docker run -d --name php-fpm php:5.6-cli irc_bot.php ? Commented Apr 27, 2016 at 9:21

1 Answer 1

1

The main thing you're missing appears to be a volume. The container doesn't actually have a "irc_bot.php", so you probably need something like...

docker run -d -v /directory/with/file/:/dir/to/run/from/ php:5.6-cli php /dir/to/run/from/irc_bot.php

The -v mounts the first path as a volume on the container so you have access to all the files inside the container, then the end part is simply the command you want to run.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.