镜像加速
:::success window 11 docker desktop 镜像加速设置 :::
{"builder": {"gc": {"defaultKeepStorage": "20GB","enabled": true}},"experimental": false,"features": {"buildkit": true},"registry-mirrors": ["https://kzueud5d.mirror.aliyuncs.com"]}
镜像构建
Build a Dockerfile to create an image using Nginx to share your content with others. You can use a Dockerfile to generate a new image that includes the necessary content.
- Create a file and name it Dockerfile in your local directoryAdd the contents of the file:
FROM nginx COPY your-local-html-directory /usr/share/nginx/html
OPTIONAL: To add a custom nginx configuration file, add this line:
COPY nginx.conf /etc/nginx/nginx.conf
- Build this Dockerfile into an image using your terminal:
3.Run this image locally using the Images tab. Remember to add port 8080 so you can access the content.Or you can start it via the terminal:docker build -t myimage .
You can then view it in your http://localhost:8080 browser.docker run --name some-nginx -d -p 8080:49153 myimage
For more information, see the nginx documentation and the nginx blog post.
