首页 > 其他分享 >3-运行第一个docker image-hello world

3-运行第一个docker image-hello world

时间:2023-12-09 16:06:05浏览次数:24  
标签:image hello centos79 world Docker root docker

CentOS7.9下安装完成docker后,我们开始部署第一个docker image-hello world

1.以root用户登录CentOS7.9服务器,拉取centos7 images

命令:

docker pull hello-world

[root@centos79 ~]# docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
2db29710123e: Pull complete 
Digest: sha256:2498fce14358aa50ead0cc6c19990fc6ff866ce72aeb5546e1d59caac3d0d60f
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
[root@centos79 ~]#

2.查看docker镜像

命令:

docker images | grep hello-world

[root@centos79 ~]# docker images | grep hello-world
hello-world                  latest     feb5d9fea6a5   2 years ago     13.3kB
[root@centos79 ~]#

3.运行docker镜像hello-world

命令:

docker run hello-world

[root@centos79 ~]# docker run 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/

[root@centos79 ~]#



标签:image,hello,centos79,world,Docker,root,docker
From: https://blog.51cto.com/ztj1216/8749727

相关文章

  • Image Layout 和 Layout Transition
    ImageLayout和 LayoutTransition在RenderPass创建参数中需要指定RenderPass开始时和RenderPass结束时的ImageLayout也就是initLayout和finalLayout。因为不同的ImageLayout会影响到像素在内存中的组织方式。由于图形硬件的工作方式,对于Image来说线性布局往往不是性能最优的(B......
  • Docker入门教程
    什么是DockerDocker是开源的应用容器引擎。Docker可以让你将所有应用软件以及它的以来打包成软件开发的标准化单元。Docker容器将软件以及它运行安装所需的一切文件(代码、运行时、系统工具、系统库)打包到一起,这就保证了不管是在什么样的运行环境,总是能以相同的方式运行。就好像......
  • Docker build 无法解析域名
    ###报错Dockerbuild无法解析域名报错:ERROR[2/12]RUNcurl-o/etc/yum.repos.d/CentOS-Base.repohttps://mirrors.aliyun.com/repo/Centos-7.repo解决Dockerbuild无法解析域名#追加到etc/docker/daemon.json,注意JSON的格式{"dns":["8.8.8.8","114.114.1......
  • hello world
    防火墙相关概念防火墙定义防火墙技术是通过有机结合各类用于安全管理与筛选的软件和硬件设备,帮助计算机网络于其内、外网之间构建一道相对隔绝的保护屏障,以保护用户资料与信息安全性的一种技术。用途防火墙技术的功能主要在于及时发现并处理计算机网络运行时可能存在的安全风......
  • 记一次docker buildx build 推送到本地私有仓库出现 connection refused 的问题
    想在本地编译多个架构的基础镜像,这样后续有其他业务使用的时候,不必从头开始编译。使用传统的dockerbuild-tImageName:tag方式,只能编译和主机相同架构的镜像。而dockerbuildxbuild不支持将编译好的镜像放置在本地docker中,只能以文件的形式放在本地。因此需要在本地搭建......
  • Docker 入门指南:轻松驾驭容器技术
    什么是Docker?Docker是一种容器技术,可以让你的应用程序在任何地方运行,无论是在你的开发机、测试环境还是生产服务器。这就像是一个神奇的魔法箱,把你的应用程序和它所需的一切打包在一起,确保它可以在任何地方一键运行。为什么使用Docker?跨平台性:Docker能够确保你的应用程序在不......
  • Docker - Build an application to an image
    Dockerfile:#BuildstageFROMgolang:1.21.5-alpine3.18ASbuilderWORKDIR/appCOPY..RUNgoenv-wGOPROXY=https://goproxy.io,directRUNgobuild-omainmain.go#RunstageFROMalpine:3.18WORKDIR/appCOPY--from=builder/app/main.COPYapp.env......
  • 被动副业机赚钱项目教程,Docker一键运行
    被动副业机赚钱项目教程,Docker一键运行软件下载视频教程/opt/wxedge_storage路径换成你设备里面的路径即可,其余参数不用变,镜像名为onething1/wxedge更多安装说明,可参考官方文档:容器魔方产品介绍dockerrun-d--name=wxedge\--restart=always--privileged--net=host\-......
  • Docker部署ELK日志系统
    Docker部署ELK日志系统皓林 Java老王 2023-12-0515:27 发表于广东 一、Docker安装Elasticsearch官网镜像地址:https://hub.docker.com/_/elasticsearch1.1 下载镜像 查看镜像sudo dockerpullelasticsearch:7.6.1sudo dockerimages1.2 运行 elasticsear......
  • linux Docker容器日志查看与清理2
    问题:docker容器日志随着时间变得越来越大。本来分的200G磁盘空间迅速不太够用。 日志查找:docker安装目录一般在/var/lib/docker下:执行以下命令,可查看各文件夹空间占用情况:du-h-x--max-depth=1我们可以看到containers目录占用了181G的空间:进入到containers容器目录,......