Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

797
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda