Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

796
Views
Docker permission denied - apache image - Hello World

Docker file is as follows:

FROM php:7.2-apache
COPY src/ /var/www/html/
EXPOSE 80

Ran docker commands:

docker build -t hello-world .
docker run -p 80:80 hello-world

Project structure:

projectRoot
         Dockerfile
         src/index.html

What is causing permission denied when I do http://localhost:80

172.17.0.1 - - [08/Apr/2020:19:05:00 +0000] "GET / HTTP/1.1" 403 490 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
172.17.0.1 - - [08/Apr/2020:19:05:00 +0000] "GET / HTTP/1.1" 403 490 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"
[Wed Apr 08 19:05:00.837027 2020] [autoindex:error] [pid 17] [client 172.17.0.1:40036] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
[Wed Apr 08 19:05:00.894055 2020] [autoindex:error] [pid 17] [client 172.17.0.1:40036] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

ADD will copy the contents of your local directory to /var/www/html and COPY will copy the whole folder to /var/www/html so apache won't find the index.html because it will be here /var/www/html/src/index.html

Edit the dockerfile to be like that

FROM php:7.2-apache
ADD src /var/www/html/
EXPOSE 80
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!