以后的文档阅读笔记不在一一介绍。以后只总结干货和重点。
Step 1
使用Systemctl命令启动docker服务:
systemctl start docker // to start the docker service.
systemctl status docker // to check the status .
systemctl restart docker // to restart the service.
Step 2
拉取一个Rhel系统的镜像,并安装python3。
-it:interactive terminal,交互式终端;
os_name - 名称;
centos: latest - 镜像版本;
然后使用yum进行安装:
yum install python3
Step 3
安装 GUI 程序,firefox、jupyter、gedit
yum install firefox -y // to install firefox
pip3 install jupyter // to install jupyter
yum install gedit -y // to install gedit
Step 4
从刚刚启动的容器里面创建新的镜像
exit // to exit from the container ,
docker commit os_name image_name:version // Now you are in base OS type the
// following given below command.
commit命令就在运行的容器中创建镜像。
最后用如下命令将新新建的镜像,跑起来:
docker run -it --name container_name --env=”Display” -- net=host image_name:version
Step 5
在容器中输入如下命令:
firefox // to run firefox inside the docker
jupyter notebook // to run jupyter inside the docker
gedit // to run gedit inside the docker
exit // to exit from the container