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:

  • How to use custom Nginx config for official nginx Docker image?
  • Local private Docker registry will not respond
  • Docker containers gone after a while in CoreOS
  • Docker log in command does not work
  • Remote communication with private docker registry issues
  • How to increase Docker container default size?
  • Forbidden
    You don't have permission to access / on this server.

    what am I doing wrong?

  • Cannot remove dead docker containers. Storage driver: btrfs
  • How to manage docker image dependencies (maintainance)
  • What is the recommended setup for an Elasticsearch cluster that contains data at the scale of TBs and above? [closed]
  • Docker-Swarm, Kubernetes, Mesos & Core-OS Fleet
  • Should I run the init process inside a Docker container or not? [closed]
  • Error when creating container with golang docker engine
  • 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.