docker拉取nginx镜像失败(m4/arm64架构)

执行docker pull nginx:latest的报错信息

Error response from daemon: failed to resolve reference "docker.io/library/nginx:latest": failed to do request: Head "https://docker.mirrors.ustc.edu.cn/v2/library/nginx/manifests/latest?ns=docker.io": dialing docker.mirrors.ustc.edu.cn:443 container via direct connection because Docker Desktop has no HTTPS proxy: connecting to docker.mirrors.ustc.edu.cn:443: dial tcp: lookup docker.mirrors.ustc.edu.cn: no such host

解决方法:

  1. 执行以下指令拉取镜像

    docker pull registry.cn-shenzhen.aliyuncs.com/amgs/nginx:latest

  2. 运行容器

    docker run -d -p 8080:80 --name my-nginx registry.cn-shenzhen.aliyuncs.com/amgs/nginx:latest

    复制代码
    -d:让容器在后台运行。
    -p:Publish a container's port(s) to the host。-p 8080:80将主机的 8080 端口映射到容器的 80 端口
    --name:Assign a name to the container。--name my-nginx将容器命名为 my-nginx
    registry.cn-shenzhen.aliyuncs.com/amgs/nginx:latest:要运行的镜像名称
  3. 访问http://localhost:8080 可以看到nginx的欢迎界面

相关推荐
卧室小白11 小时前
docker容器
运维·docker·容器
Benszen12 小时前
Docker容器化解决方案
运维·docker·容器
仙柒41513 小时前
Namespace
运维·docker·容器
pigs201814 小时前
Docker容器中Kingbase数据库授权到期更换解决方案
数据库·docker·容器
m0_7510186615 小时前
docker 安装 nginx
vue.js·nginx·docker
人工智能培训15 小时前
AI人工智能未来发展趋势
人工智能·深度学习·机器学习·docker·容器
成为你的宁宁16 小时前
【基于 Docker-compose 部署 Prometheus 监控系统实战教程 】
docker·容器·prometheus
梦梦代码精16 小时前
LikeShop按摩到家系统:2026年本地生活创业新风口,上门服务O2O源码私有化部署实战
大数据·docker·小程序·uni-app·生活·高并发·开源软件
xiaogg367817 小时前
k8s 部署yaml文件和Dockerfile文件配置
java·docker·kubernetes
日取其半万世不竭17 小时前
Docker 网络模式详解:bridge、host、overlay 和 macvlan
网络·docker·容器