陕西建工第五建设集团有限公司官方网站,商务网站建设摘要,我想建个网站怎么建,短视频运营公司常用命令
管理命令
管理命令说明builder管理构建config管理配置container管理容器context管理上下文engine管理引擎image管理镜像network管理网络node管理 Swarm 节点plugin管理插件secret管理 Docker secretsservice管理服务stack管理 Docker stacksswarm管理 Swarm 集群sys…常用命令
管理命令
管理命令说明builder管理构建config管理配置container管理容器context管理上下文engine管理引擎image管理镜像network管理网络node管理 Swarm 节点plugin管理插件secret管理 Docker secretsservice管理服务stack管理 Docker stacksswarm管理 Swarm 集群system查看系统信息trust管理 Docker trustvolume管理卷
普通命令
容器生命周期管理
命令说明run创建一个新的容器并运行一个命令start启动容器stop停止容器restart重启容器killkill 运行中的容器rm删除容器pause暂停一个或多个容器中的所有进程unpause恢复容器中所有的进程create创建一个新容器exec在正在运行的容器中运行命令
容器操作
命令说明ps查看容器列表inspect返回 Docker 对象的低级信息top展示一个容器中运行的进程attach进入一个运行的容器events从服务器获取实时事件logs获取一个容器的日志wait阻塞直到容器停止然后打印退出代码export将容器的文件系统导出为 tar 存档port查看端口映射或容器的特定映射列表stats实时显示容器资源使用情况的统计信息update更新容器配置
容器 rootfs 命令
命令说明commit从容器变更记录中创建一个镜像cp在容器和宿主机文件系统之间拷贝文件diff检查对容器文件系统上的文件或目录的更改
镜像仓库
命令说明login登陆 Docker 镜像仓库logout登出 Docker 镜像仓库pull从镜像仓库拉取镜像push将本地的镜像上传到镜像仓库,要先登陆到镜像仓库search从 Docker Hub 搜索镜像
本地镜像管理
命令说明images查看镜像列表rmi删除镜像tag标记本地镜像将其归入某一仓库build根据 DockerFile 构建镜像history显示镜像的构建历史记录save将指定镜像保存成 tar 归档文件load从存档或者 STDIN 加载镜像import从归档文件中创建镜像rename重命名容器
相关信息
命令说明waitinfo显示系统范围的信息version显示 Docker 的版本信息
宿主机操作
端口和磁盘目录的映射
# 将宿主机的 81 端口映射到容器的 80 端口
# 将宿主机的 /develop/data 卷 映射到容器的 /data 卷
$ docker run -i -t -p 81:80 -v /develop/data:/data centos /bin/bash-p映射端口号-v磁盘目录映射
Docker 更改端口号映射
运行中的容器无法映射新的端口号也无法更改端口号映射但可以通过两种方法解决。
iptable 转发端口
# 查看容器 IP
$ docker insepct 36afde543eb5 | grep IPAddressIPAddress: 172.17.0.2# 将主机的 8081 端口映射到宿主机的 8080 端口
$ iptables -t nat -A DOCKER -p tcp --dport 8081 -j DNAT --to-destination 172.17.0.2:8080先提交容器为镜像再运行这个容器同时指定新的端口映射
# 提交容器为镜像
$ docker commit 9995ffa15f46 mycentos:0.1# 停止旧的容器
$ docker stop 9995ffa15f46# 重新从旧的镜像启动容器
$ docker run -i -t -p 8081:8080 mycentos:0.1宿主机关于 Docker 的操作
# 开启 docker
service docker start# 重启
service docker restart# 暂停
service docker stopDocker Hub
创建和使用私有仓库
#
docker run -eSEARCH_BACKENDsqlalchemy-eSQLALCHEMY_INDEX_DATABASEsqlite:tmp/docker-registry.db-d -name registry -p 5000:5000 registry原版指令指引
按首字母大小写排列
attach Attach local standard input, output, and error streams to a running containerbuild Build an image from a Dockerfilecommit Create a new image from a container’s changescp Copy files/folders between a container and the local filesystemcreate Create a new containerdiff Inspect changes to files or directories on a container’s filesystemevents Get real time events from the serverexec Run a command in a running containerexport Export a container’s filesystem as a tar archivehistory Show the history of an imageimages List imagesimport Import the contents from a tarball to create a filesystem imageinfo Display system-wide informationinspect Return low-level information on Docker objectskill Kill one or more running containersload Load an image from a tar archive or STDINlogin Log in to a Docker registrylogout Log out from a Docker registrylogs Fetch the logs of a containerpause Pause all processes within one or more containersport List port mappings or a specific mapping for the containerps List containerspull Pull an image or a repository from a registrypush Push an image or a repository to a registryrename Rename a containerrestart Restart one or more containersrm Remove one or more containersrmi Remove one or more imagesrun Run a command in a new containersave Save one or more images to a tar archive (streamed to STDOUT by default)search Search the Docker Hub for imagesstart Start one or more stopped containersstats Display a live stream of container(s) resource usage statisticsstop Stop one or more running containerstag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGEtop Display the running processes of a containerunpause Unpause all processes within one or more containersupdate Update configuration of one or more containersversion Show the Docker version informationwait Block until one or more containers stop, then print their exit codes