docker仓库

docker仓库

文章目录

概述

仓库(Repository)是集中存放镜像的地方

docker仓库常用命令

登录

shell 复制代码
docker login

登出

shell 复制代码
docker logout

拉取镜像

shell 复制代码
 docker pull ubuntu

推送镜像

用户登录后,可以通过 docker push 命令将自己的镜像推送到 Docker Hub。 以下命令中的 szitcast请替换为你的 Docker 账号用户名。

shell 复制代码
docker login
# 将本地镜像重命名成规范名称

deng@itcast:~$ docker tag hello-world:latest szitcast/hello:v1.0
deng@itcast:~$ docker images
#推送自己的镜像
deng@itcast:~$ docker push szitcast/hello:v1.0
#查询自己账户的镜像
deng@itcast:~$ docker search szitcast/hello

运行日志

查看日志

shell 复制代码
docker logs clever_johnson

容器详细信息

shell 复制代码
docker inspect [容器id|镜像id]

#示例一:
docker inspect c9d12ce939a0

查看容器端口信息

shell 复制代码
docker port <container_id>
# 示例:
docker port c9d12ce939a0

映射

随机映射

shell 复制代码
docker run -d -P nginx
#随机启动多个个,端口都不会重复  docker run -d -P nginx  docker run -d -P nginx

指定端口映射

shell 复制代码
docker run -d -p 10086:80 nginx

查看映射端口信息

shell 复制代码
docker port sad_gates

host模式

shell 复制代码
docker run -d --network host nginx
docker ps
相关推荐
隔窗听雨眠12 分钟前
KWDB容器化部署的形态选择与参数细节
docker·时序数据库·kwdb
SeanQhl5 小时前
openEuler 下 Docker 镜像操作与多阶段构建瘦身
docker·容器·镜像·openeuler·dockerfile
新*8 小时前
ES 7.17 三节点 Docker 集群的自动备份:从 NFS 被拦住到用 ACL 根治权限
运维·elasticsearch·docker·slm·快照备份
Wellijohn9 小时前
Docker 镜像从 1.2GB 压到 180MB:按这个顺序改,别一上来就 multistage
docker
AR-26710-13 小时前
docker Day4——命令小结与实操作业
运维·docker·容器
AR-26710-1 天前
docker Day3——镜像,容器,日志与元数据
运维·docker·容器
duansamve1 天前
docker compose使用详解
docker
csdn_aspnet1 天前
使用 Docker 运行 Microsoft SQL 数据库服务器
数据库·microsoft·docker·sqlserver
SeanQhl1 天前
openEuler 下 Docker 静态安装与容器基础操作
linux·docker·云原生·容器·openeuler
xbzb2 天前
Kubernetes ReplicaSet:副本数自愈、标签接管与 orphan 删除实测
容器·kubernetes·删除·pod·replicaset·orphan