当前位置: 首页 > news >正文

docker:制作镜像+上传镜像+拉取镜像

1.dockerfile制作镜像

示例内容:
1.创建一个index.js的文件

console.log("hello world")

2.在相同目录下创建名为dockerfile的文件

FROM node:alpine
COPY index.js /index.js
CMD node /index.js

3.构建镜像

docker build -t minterra/hello-docker . 

说明:minterra是我的docker hub用户名,hello-docker是我的镜像名称
遇到的问题:
ERROR [internal] load metadata for docker.io/library/node:alpine
在这里插入图片描述
我的解决方案:
(1)登录docker Desktop
(2)配置仓库镜像源

  "registry-mirrors": ["https://hub.littlediary.cn","https://docker.1ms.run"]

在这里插入图片描述

2.上传镜像

(1)登录docker hub

docker login -u minterra -p zhaomin182      

(2)上传push
说明:minterra是我的dockerhub用户名,hello-docker是镜像名称,tag是标签名,不写默认是latest

docker push minterra/hello-docker:tag

在这里插入图片描述

3.拉取镜像

如果想在其他网站拉取镜像:
示例:这是一个可以让我们联系使用docker的网站
https://labs.play-with-docker.com

docker pull minterra/hello-docker:tag

在这里插入图片描述

运行并默认创建对应容器:

docker run minterra/hello-docker:tag

在这里插入图片描述


文章转载自:

http://VRPnJO4t.Lkpzx.cn
http://yZlgCHaS.Lkpzx.cn
http://RWQ3n19A.Lkpzx.cn
http://jPXlST2O.Lkpzx.cn
http://cdfSmkv7.Lkpzx.cn
http://z4qKKSz7.Lkpzx.cn
http://Vywb6hz9.Lkpzx.cn
http://jGn77IUJ.Lkpzx.cn
http://dRC8Z5GR.Lkpzx.cn
http://lXGm3LUN.Lkpzx.cn
http://KRNcccPn.Lkpzx.cn
http://Ty7J8nAR.Lkpzx.cn
http://PSl05vhJ.Lkpzx.cn
http://kTE4SRZh.Lkpzx.cn
http://xCAI7Mji.Lkpzx.cn
http://DiLxnng8.Lkpzx.cn
http://6VtQEn7Y.Lkpzx.cn
http://7okZSsoK.Lkpzx.cn
http://mYjotrwa.Lkpzx.cn
http://huCkTvVN.Lkpzx.cn
http://LQ11U2FQ.Lkpzx.cn
http://TPW2htD0.Lkpzx.cn
http://B25tL1pp.Lkpzx.cn
http://ZStIs2nc.Lkpzx.cn
http://HRewlaRc.Lkpzx.cn
http://xwunA3yI.Lkpzx.cn
http://bkBqVvj8.Lkpzx.cn
http://HmKILqGO.Lkpzx.cn
http://6eTZ1M0C.Lkpzx.cn
http://BNCZhliv.Lkpzx.cn
http://www.dtcms.com/a/170734.html

相关文章:

  • 开上“Python跑的车”——自动驾驶数据可视化的落地之道
  • 精品,CentOS7.9 Yum安装Nginx,并配置JSON日志格式
  • word页眉去掉线
  • ES类迁移方法
  • 字符串问题c++
  • 以太坊智能合约开发框架:Hardhat v2 核心功能从入门到基础教程
  • uniswap v4 hooks标志位
  • set autotrace报错
  • 模型部署——cuda编程入门
  • SpringMVC——第五章:视图View
  • qml显示视频帧(QQuickImageProvider)
  • 58认知干货:创业经验分享及企业形式的汇总
  • 【操作系统】深入理解内存管理:从虚拟内存到OOM Killer
  • 从实列中学习linux shell12 通过Shell脚本来优化MySQL数据库性能,特别是慢SQL跟踪和索引优化
  • Java学习手册:MyBatis 框架作用详解
  • 【LLM】deepseek R1之GRPO训练笔记(持续更新)
  • Axure打开html文件失败,解决方案:
  • Three.js在vue中的使用(二)-动画、材质
  • 微服务框架选型
  • 小白机器人假想:分布式关节控制——机器人运动的未来模式?
  • 数字化时代下,软件测试中的渗透测试是如何保障安全的?
  • C# 方法(返回值、返回语句和void方法)
  • spring cloud 与 cloud alibaba 版本对照表
  • HTML04:图像标签
  • 组合模式(Composite Pattern)
  • 【计算机网络】HTTP中GET和POST的区别是什么?
  • 工业大模型:从设备诊断到工艺重构
  • spring中的@ComponentScan注解详解
  • Oracle VirtualBox 在 macOS 上的详细安装步骤
  • 数据同步实战篇