Forbidden in oficial image Docker PHP

I testing the oficial image docker PHP:

docker run -d -p 8000:80 --name test php:7-apache

Then, I test http://localhost:8000, I find this:

  • Pods doesn't run on another node after its node down
  • kpm restore unable to find System.Net.Http
  • Reattaching orphaned docker volumes
  • Unicorn error adding listener
  • Creating Docker container for mapped drive
  • Logs of a docker container
  • Forbidden
    You don't have permission to access / on this server.

    what am I doing wrong?

  • Pecl doesn't work in php:7.0-fpm image
  • How to use run deck service from local browser using up address?
  • Automatic way to pick up the hostname inside docker container
  • Can you efficiently change a lower level Docker container, without rebuilding all the apps that rely on it?
  • Elastic Beanstalk Docker - How to get container logs
  • Spring Properties from Docker Environment Variables
  • 2 Solutions collect form web for “Forbidden in oficial image Docker PHP”

    There’s no hello world included with this image, /var/www/html/ is empty so there’s no content to view. You need to bundle your own code in as the page on this image instructs:

    We recommend that you add a custom php.ini configuration. COPY it into
    /usr/local/etc/php by adding one more line to the Dockerfile above and
    running the same commands to build and run:

    FROM php:7.0-apache
    COPY config/php.ini /usr/local/etc/php/
    COPY src/ /var/www/html/
    docker run -d -p 8000:80 --name test php:7-apache -v "$PWD":/var/www/html

    Go to your project folder and run the above command or replace $PWD with your project directory. -v will sync your project to the docker container.

    Or create a Docker file and use copy to run your project within the container.

    Any one of the above will solve your problem.
    The probable reason for the error is the fact that there is no project to render.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.