前言
这次实验根据老师给的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)使用图形化管理界面