【Docker】Docker实战 |
您所在的位置:网站首页 › 刃影实战 › 【Docker】Docker实战 |
文章目录
搭建nginx服务搭建私有库Busybox阿里云上创建私有库
搭建nginx服务
首先拉取nginx的镜像。 docker pull nginx:1.24.0以后台的方式运行nginx,并且创建一个shell进行交互。 docker run --name nginx1 --rm -it -p 8080:80 nginx:1.24.0 bash #在交互的bash中启动nginx nginx下面修改nginx的首页为welcome to my nginx1! cd /usr/share/nginx/html cat index.html echo "Welcome to my nginx1!" > index.html通过浏览器访问nginx1,成功访问到nginx。 BusyBox 是一个集成了三百多个最常用 Linux 命令和工具的软件。 BusyBox 包含了一些简单的工具,例如 ls、 cat 和 echo 等等,还包含了一些更大、更复杂的工具,例如grep、 find、 mount 以及 telnet。 BusyBox 就好像是个大工具箱,它集成压缩了 Linux 的许多工具和命令,也包含了 Linux 系统的自带的 shell。 busybox 是一个集成了一百多个最常用 linux 命令和工具的软件,他甚至还集成了一个 http 服务器和一个 telnet 服务器,而所有这一切功能却只有区区 1M 左右的大小 。 Busybox下载: wget https://busybox.net/downloads/binaries/1.28.1-defconfig-multiarch/busybox-x86_64 --no-check-certificate mv busybox-x86_64 busybox chmod +x busybox ./busyboxbosybox的使用 ./busybox ls ./进入阿里云 https://www.aliyun.com/ ,选择容器镜像服务。 创建仓库: 登陆阿里云镜像,阿里云提供了完整的命令: 接下来我们将本地的busybox,并上传到我们的私有仓库中。 docker pull busybox:latest docker tag busybox:latest registry.cn-hangzhou.aliyuncs.com/westmo/req1:v0.3 docker push registry.cn-hangzhou.aliyuncs.com/westmo/req1:v0.3查看私有仓库是否有镜像文件: 下面我们试着拉取阿里云上面的镜像文件: docker pull registry.cn-hangzhou.aliyuncs.com/westmo/req1:v0.3退出仓库: docker logout registry.cn-hangzhou.aliyuncs.com |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |