-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Docs: Improve the usability and security of Docker on Unix #8432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
I added the docker documentation reference of the ports publication on the initial comment. |
Thanks for the PR! Could you please elaborate a little more why the changes are necessary? Please keep in mind that we want to keep the getting started guide as simple as possible, and this does not include having a hardened setup. The Docker image is only intended for previewing, not for production. Additionally, please understand that we're currently very busy with bigger picture topics, so this change has to wait for a bit. |
Thanks for your response.
Yes, I understand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for the PR and providing more information. I agree regarding security by default, and I wasn't aware that we can scope this to be less permissive. I thought exposing on 0.0.0.0 is the only thing that works. Does this also mean we can just use 127.0.0.1 in Docker, and map that through as well?
Please also read the comments, I have some minor remarks.
After you've [installed] Material for MkDocs, you can bootstrap your project | ||
documentation using the `mkdocs` executable. Go to the directory where you want | ||
your project to be located and enter: | ||
After you've [installed] Material for MkDocs, you can bootstrap your documentation project then preview your documentation and finaly build your site using the `mkdocs` executable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why this change is necessary? It doesn't have anything to do with what you described in your PR.
=== "Unix" | ||
|
||
``` | ||
docker run --rm \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format this as:
docker run --rm \
... (two spaces) \
.... (and so on)
``` | ||
docker run --rm \ | ||
--user $(id -u):$(id -g) \ | ||
--volume $(pwd):/docs \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove -it
?
--user $(id -u):$(id -g) \ | ||
--volume $(pwd):/docs \ | ||
squidfunk/mkdocs-material \ | ||
new . # bootstrap project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the comment, this is not necessary, as it's described in the paragraph above.
--user $(id -u):$(id -g) \ | ||
--volume $(pwd):/docs \ | ||
--publish 127.0.0.1:8000:8000 \ | ||
squidfunk/mkdocs-material |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
docker run --rm \ | ||
--user $(id -u):$(id -g) \ | ||
--volume $(pwd):/docs \ | ||
squidfunk/mkdocs-material \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
Hello,
Important
Publishing container ports is insecure by default. Meaning, when you publish a container's ports it becomes available not only to the Docker host, but to the outside world as well.
If you include the localhost IP address (127.0.0.1, or ::1) with the publish flag, only the Docker host and its containers can access the published container port.
https://docs.docker.com/engine/network/#published-ports