前言
这次实验根据老师给的ppt,在ubuntu上完成
1.安装Docker
sudo apt-get remove docker docker-engine docker-ce docker.io
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
安装完成后,验证安装:

运行简单镜像

2.基本操作
运行镜像

显示本地镜像库内容

显示运行中容器

显示所有容器(包含已中止)

3.构建docker镜像练习
mkdir mydock && cd mydock
vi dockerfile
在vi里加入以下几句

docker build . -t hello
docker run -it --rm hello -H

4.MySQL与容器化
(1)拉取Mysql

(2)启动服务器

(3)启动 MySQL 客户端

(4)使用docker内的mysql
.(5)数据库文件的挂载



5.Docker仓库
(1)Run a local registry

(2)Pull the ubuntu:16.04 image from Docker Hub.

(3)Tag the image

(4)Push the image to the local registry

(5)Remove the locally-cached ubuntu:16.04 and localhost:5000/my-ubuntu.

(6)Pull the localhost:5000/my-ubuntu image from your local registry.

(7)Stop a local registry

6.阿里云实践
1.登陆

2.标签

3.上传

4.下载

5.标签

6.删除

7.运行

8.退出

6.docker图形化管理工具
(1)装载Portainer

(2)使用图形化管理界面



本文详细介绍了Docker的安装步骤及验证方法,演示了Docker的基本操作,包括镜像的运行与管理。深入探讨了Docker镜像构建过程,并通过MySQL的容器化实践展示其在数据库管理中的应用。此外,文章还涵盖了Docker仓库的使用,包括本地仓库的搭建与镜像的推送、拉取。最后,介绍了Docker在阿里云平台上的应用,以及图形化管理工具Portainer的使用。
1348

被折叠的 条评论
为什么被折叠?



