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
相关推荐
瞬间&永恒~31 分钟前
【Docker】(四)Namespace 详解
运维·docker·容器
就改了41 分钟前
Docker安装并运行Redis
redis·docker·容器
yagami_gagami2 小时前
第四届黄河流域公安院校电子物证个人赛服务器取证
linux·服务器·网络·mysql·安全·docker·llama
小挪号底迪滴3 小时前
Docker 多阶段构建实战:让 Python 镜像更小、更快、更安全
python·安全·docker
风曦Kisaki3 小时前
Kubernetes(K8s)笔记Day07: StatefulSet 有状态控制器详解与使用案例
linux·docker·云原生·容器·kubernetes
张文君3 小时前
docker registry 删除镜像
运维·docker·容器
cuiyaonan20003 小时前
some weird issues regarding docker
运维·docker·容器
zerwave3 小时前
Docker 学习:多容器网络互通——从 host 模式到自定义 bridge 网络
网络·学习·docker
程序喵大人4 小时前
【C++进阶】STL容器与迭代器 - 10 把容器、迭代器和数据流串成一个小程序
开发语言·c++·容器·小程序·迭代器·stl
隔窗听雨眠21 小时前
生产级Kubernetes集群部署完全指南:从kubeadm到高可用架构落地
容器·架构·kubernetes