docker镜像拉取、运行、删除

1.拉去hello-world镜像并运行

docker pull hello-world 拉取hello-world镜像
Using default tag: latest
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:4fe721ccc2e8dc7362278a29dc660d833570ec2682f4e4194f4ee23e415e1064
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
[[email protected] ~]# docker images 查看当前docker镜像
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 12 months ago 1.84kB
[[email protected] ~]# docker run --name myhelloword hello-world 运行hello-world镜像

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

docker ps 查看正在运行的容器
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[[email protected] ~]# docker ps -a 查看后台存在的容器
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e3854e40102c hello-world "/hello" 3 minutes ago Exited (0) 3 minutes ago myhelloword

原文地址:https://www.cnblogs.com/flgb/p/12142894.html

时间: 2024-07-31 08:55:34

docker镜像拉取、运行、删除的相关文章

K8s 从懵圈到熟练 – 镜像拉取这件小事

作者 | 声东 阿里云售后技术专家 导读:相比 K8s 集群的其他功能,私有镜像的自动拉取,看起来可能是比较简单的.而镜像拉取失败,大多数情况下都和权限有关.所以,在处理相关问题的时候,我们往往会轻松的说:这问题很简单,肯定是权限问题.但实际的情况是,我们经常为一个问题,花了多个人的时间却找不到原因.这主要还是我们对镜像拉取,特别是私有镜像自动拉取的原理理解不深.这篇文章,作者将带领大家讨论下相关原理. 顺序上来说,私有镜像自动拉取会首先通过阿里云 Acr credential helper 组

Docker Hub.拉取镜像

注:此记录谨基于默认在搭建好的docker环境下进行!   拉取镜像很假单,只需要一个“docker pull 镜像名“的命令即可.当然,前提是我们已经在一个已经搭建好的docker环境下.但是,如何将拉取到主机的镜像下载到本地电脑呢.请看如下记录: 假设我们要拉取的镜像是一个note基础镜像,那么我们执行的命令首先是:docker pull note .当镜像下载成功,我们需要检查一下,该镜像是否已经存在主机了.可以执行:docker images 查看镜像是否存在,如果没错的话,应该是有 n

K8s之Pod资源管理及创建Harbor私有镜像仓库(含镜像拉取操作,中途含排错)

pod是k8s管理的最小单元 pod中有多个容器,现实生产环境中只有一个容器 特点: 1.最小部署单元2.一组容器的集合3.一个Pod中的容器共享网络命令空间4.Pod是短暂的 Pod容器分类: 1:infrastructure container 基础容器(透明的过程,用户无感知) 维护整个Pod网络空间 node节点操作 `查看容器的网络` [[email protected] ~]# cat /opt/kubernetes/cfg/kubelet KUBELET_OPTS="--logto

yaml文件中镜像拉取策略

yaml文件中镜像拉取策略解释: containers: - name: coredns image: coredns/coredns:1.2.0 imagePullPolicy: IfNotPresent IfNotPresent :如果本地存在镜像就优先使用本地镜像. Never:直接不再去拉取镜像了,使用本地的:如果本地不存在就报异常了. Always 如果你yaml配置文件中没有定义那就是使用默认的 原文地址:https://www.cnblogs.com/effortsing/p/10

【Docker学习之三】Docker查找拉取镜像、启动容器、容器使用

环境 docker-ce-19.03.1-3.el7.x86_64 CentOS 7 一.查找.拉取镜像.启动容器1.查找镜像-docker search默认查找Docker Hub上的镜像,举例:Docker安装nginx [[email protected] ~]# docker search nginx NAME DESCRIPTION STARS OFFICIAL AUTOMATED nginx Official build of Nginx. 11866 [OK] jwilder/ng

asp.net core webapi 使用ef 对mysql进行增删改查,并生成Docker镜像构建容器运行

1.构建运行mysql容器,添加数据库user 参考Docker创建运行多个mysql容器,地址 http://www.cnblogs.com/heyangyi/p/9288402.html 添加user数据库,添加tbusers表 2.创建asp.net core webapi 应用程序 参考Docker 为 ASP.NET Core WebApi 应用程序生成 Docker 映像,创建容器并运行,地址 http://www.cnblogs.com/heyangyi/p/9323407.htm

kubernetes国内镜像拉取

因国内访问不到goole服务器,只能拉取国内的镜像,这里以阿里云为例. 安装minikube时报failed to pull image "k8s.gcr.io/kube-apiserver:v1.13.4". 原理:先拉取阿里镜像,再改名 docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.2.24 docker tag registry.cn-hangzhou.aliyuncs.com/goo

Pod镜像拉取策略imagePullPolicy

默认值是IfNotPresent Always 总是拉取: 首先获取仓库镜像信息, 如果仓库中的镜像与本地不同,那么仓库中的镜像会被拉取并覆盖本地. 如果仓库中的镜像与本地一致,那么不会拉取镜像. 如果仓库不可用,那么pod运行失败. IfNotPresent 优先使用本地: 如果本地存在镜像,则使用本地的, 不管仓库是否可用. 不管仓库中镜像与本地是否一致. Never 只使用本地镜像,如果本地不存在,则pod运行失败 原文地址:https://www.cnblogs.com/orchidzj

使用Jenkins docker镜像运行Jenkins服务

需求 使用docker技术管理Jenkins服务器.避免多次部署需要重复安装的重复工作,且可以方便迁移到新的服务器. Jenkins docker镜像 https://hub.docker.com/_/jenkins/ Official Jenkins Docker image 拉取镜像: docker pull jenkins 使用镜像: docker run --name myjenkins -p 8080:8080 -p 50000:50000 -v /var/jenkins_home j