Set up
So I am new to Docker and currently learning by following tutorials and docker official documentation online. So I have created a dummy project with only two files which are index.php and Dockerfile.
Dockerfile:
FROM php:7.2-apache
Background
- I have enabled the windows 10 virtualization option
- I have installed docker toolbox together with Oracle VM VirtualBox.
- Here is the result of running docker version
Client:
Version: 19.03.1
API version: 1.39 (downgraded from 1.40)
Go version: go1.12.7
Git commit: 74b1e89e8a
Built: Wed Jul 31 15:18:18 2019
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.9
API version: 1.39 (minimum version 1.12)
Go version: go1.11.13
Git commit: 039a7df9ba
Built: Wed Sep 4 16:55:50 2019
OS/Arch: linux/amd64
Experimental: false
So I am trying to set up an apache server for php development and here are the commands that I have run.
- build the image
docker build .
- create the container
docker container run -d -p 4000:80 [imageID]
- Accessing the server through browser, my VM IP address is 192.168.99.100. So I tried
http://192.168.99.100:4000
But I got this error:
Forbidden
You don't have permission to access / on this server.
Apache/2.4.38 (Debian) Server at 192.168.99.100 Port 4000
Questions
Why the problem occurs? Is it because I haven't added myself to the server user group?
if Q1's response is yes, then how can I grant permission? 2.1 I have tried to find an apache config file but since the apache server is created using docker I don't exactly know where to find it. I shouldn't change it, right?
2.2 I also tried to looked into window user group permissions through Computer Management Center, but I don't have that option in my version of windows
- (Option) I currently using the IP address that my vm running on instead of localhost. So how can I change that? again, I can't find config file for apache server.