docker icon indicating copy to clipboard operation
docker copied to clipboard

Docker Image Not Working (MacOS Sierra)

Open HewittJC opened this issue 9 years ago • 5 comments

I have tried to follow the apache docker image: $ docker run -d nextcloud When I run this it will download all the items and run okay but then when navigating to http://localhost I get a "Server not found" error.

screen shot 2017-06-08 at 11 52 37 am 1 screen shot 2017-06-08 at 11 53 12 am

The above 2 images show my steps taken to get the image going.

HewittJC avatar Jun 08 '17 15:06 HewittJC

As an update to the issue I just opened, I ran the following command and was able to see the server.

docker run -p 80:80 -d nextcloud

Not sure if this should be closed now or not, but I will leave this open since it is not documented in the main README.md file

HewittJC avatar Jun 08 '17 16:06 HewittJC

With adding -p 80:80 you expose the port of the container to your host. Without this how should your host know that it should forward incoming traffic? However the container is running in a virtual network that is running on your host. So from the host you can reach the container by it's ip address or it's name. So if you use the simple run command the container gets an generated name wich you can find out with docker ps. You can reach the container by using its name as address in your browser.

SnowMB avatar Jun 10 '17 08:06 SnowMB

@SnowMB we should probably add -p 80:80 to the docs. Because at the moment the docs just say run docker run -d nextcloud and acces it on http://localhost/. What do you think?

tilosp avatar Jun 10 '17 09:06 tilosp

It is documented here: https://github.com/nextcloud/docker#http---insecure-just-for-development--debugging--testing

I was against to show everyone how to run an insecure nextcloud instance. And that's why I said I prefer to not say how to mount it on port 80.

But indeed, currently the doc is buggy.

Reconsidering it, I'd be ok to say it is on port 8080. Then it is not insecure by default, but still easy to use and understand. (Just opened a PR for that.)

pierreozoux avatar Jun 10 '17 10:06 pierreozoux

Thanks for the input. Yea I am knew to Docker, this is one of the first uses of it for me so this is good to know. I was wondering how the networking would work to and from containers. I will run it on a different port and or use other means to secure it. Thanks.

HewittJC avatar Jun 12 '17 13:06 HewittJC