Created
November 19, 2015 14:03
-
-
Save yujiod/31af35417bffb80a08df to your computer and use it in GitHub Desktop.
Dockerfile example of php built-in server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# docker build -t docker-php-example . | |
# docker run -d -p 8080:80 docker-php-example | |
# open http://192.168.99.100:8080/ | |
FROM php | |
RUN echo "<?php echo 'Hello World';" > /tmp/index.php | |
CMD ["php", "-S", "0.0.0.0:80", "-t", "/tmp"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey buddy,
I was actually trying to do something very similar.
I can easily startup a server from within the container, but when try to do something similar to the above, I have an unexpected error and I was wondering if you would have any clues to this.
Dockerfile
And when I do
docker run -d -v "$PWD":/var/www/app -p 80:80 phpd
the CMD doesn't seem to work as expected:docker ps -a
prints the following (notice that the command cuts at -t):Any clues?