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
相关推荐
亚空间仓鼠2 小时前
Docker 容器技术入门与实践 (三):Docker私有仓库
docker·容器·eureka
小陈99cyh2 小时前
安装NVIDIA Container Toolkit,让gpu容器环境跑通
运维·pytorch·docker·nvidia
雨奔2 小时前
Kubernetes Master-Node 通信全解析:路径、安全与配置
安全·容器·kubernetes
Y学院2 小时前
企业级Dify私有化部署全攻略(Docker Compose生产环境实战)
人工智能·docker·语言模型
草木红2 小时前
Python 中使用 Docker Compose
开发语言·python·docker·flask
雨奔3 小时前
Kubernetes Volume 完全指南:数据持久化与容器共享方案
云原生·容器·kubernetes
草木红3 小时前
Vue3 + Docker + Nginx 完整部署流程
nginx·docker·容器
逆向爱好者3 小时前
windows环境下通过docker安装使用Superset
windows·docker·容器
耳东哇3 小时前
linuxdocker配置毫秒镜像下载镜像
docker