初试Docker desktop与OpenVINO DL Workbench的使用入门

2024-03-15 22:48

本文主要是介绍初试Docker desktop与OpenVINO DL Workbench的使用入门,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

一,初试Docker desktop

你可以使用WIN+R 输入powershell启动powershell,也可以用anaconda的powershell 快捷方式,我选择用anaconda-powershell,进入命令界面后开始测试

运行: docker --version

(base) PS C:\Users\space> docker --version
Docker version 19.03.8, build afacb8b

从Docker Hub中拉出hello-world映像并运行一个容器: docker run hello-world

(base) PS C:\Users\space> docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete                                                                                             Digest: sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9
Status: Downloaded newer image for hello-world:latest

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 --help

 

(base) PS C:\Users\space> docker --help

Usage:  docker [OPTIONS] COMMAND

A self-sufficient runtime for containers

Options:
      --config string      Location of client config files (default
                           "C:\\Users\\space\\.docker")
  -c, --context string     Name of the context to use to connect to the
                           daemon (overrides DOCKER_HOST env var and
                           default context set with "docker context use")
  -D, --debug              Enable debug mode
  -H, --host list          Daemon socket(s) to connect to
  -l, --log-level string   Set the logging level
                           ("debug"|"info"|"warn"|"error"|"fatal")
                           (default "info")
      --tls                Use TLS; implied by --tlsverify
      --tlscacert string   Trust certs signed only by this CA (default
                           "C:\\Users\\space\\.docker\\ca.pem")
      --tlscert string     Path to TLS certificate file (default
                           "C:\\Users\\space\\.docker\\cert.pem")
      --tlskey string      Path to TLS key file (default
                           "C:\\Users\\space\\.docker\\key.pem")
      --tlsverify          Use TLS and verify the remote
  -v, --version            Print version information and quit

Management Commands:
  builder     Manage builds
  config      Manage Docker configs
  container   Manage containers
  context     Manage contexts
  image       Manage images
  network     Manage networks
  node        Manage Swarm nodes
  plugin      Manage plugins
  secret      Manage Docker secrets
  service     Manage services
  stack       Manage Docker stacks
  swarm       Manage Swarm
  system      Manage Docker
  trust       Manage trust on Docker images
  volume      Manage volumes

Commands:
  attach      Attach local standard input, output, and error streams to a running container
  build       Build an image from a Dockerfile
  commit      Create a new image from a container's changes
  cp          Copy files/folders between a container and the local filesystem
  create      Create a new container
  diff        Inspect changes to files or directories on a container's filesystem
  events      Get real time events from the server
  exec        Run a command in a running container
  export      Export a container's filesystem as a tar archive
  history     Show the history of an image
  images      List images
  import      Import the contents from a tarball to create a filesystem image
  info        Display system-wide information
  inspect     Return low-level information on Docker objects
  kill        Kill one or more running containers
  load        Load an image from a tar archive or STDIN
  login       Log in to a Docker registry
  logout      Log out from a Docker registry
  logs        Fetch the logs of a container
  pause       Pause all processes within one or more containers
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rename      Rename a container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Remove one or more images
  run         Run a command in a new container
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  search      Search the Docker Hub for images
  start       Start one or more stopped containers
  stats       Display a live stream of container(s) resource usage statistics
  stop        Stop one or more running containers
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
  top         Display the running processes of a container
  unpause     Unpause all processes within one or more containers
  update      Update configuration of one or more containers
  version     Show the Docker version information
  wait        Block until one or more containers stop, then print their exit codes

Run 'docker COMMAND --help' for more information on a command.
 

列出从Docker Hub下载的映像: docker image ls

 

(base) PS C:\Users\space> docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
hello-world         latest              bf756fb1ae65        5 months ago        13.3kB


(base) PS C:\Users\space> docker container ls --all
CONTAINER ID        IMAGE               COMMAND             CREATED              STATUS                          PORTS               NAMES
447ed27e3e03        hello-world         "/hello"            About a minute ago   Exited (0) About a minute ago                       trusting_neumann

 

拉出Ubuntu操作系统的映像并在生成的容器中运行交互

(base) PS C:\Users\space> docker run --interactive --tty ubuntu bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
a4a2a29f9ba4: Pull complete  
127c9761dcba: Pull complete
13bf203e905: Pull complete  
039240d2e0b: Pull complete
Digest: sha256:35c4a2c15539c6c1e4e5fa4e554dac323ad0107d8eb5c582d6ff386b383b7dce
Status: Downloaded newer image for ubuntu:latest
root@22583a1d1487:/#   

用exit指令退出,没有quit指令

root@22583a1d1487:/# quit
bash: quit: command not found
root@22583a1d1487:/# exit
exit
(base) PS C:\Users\space>

设置 

关于设置这里就不多说了,因为docker desktop有图形化的设置界面,很容易找到各个要设置的选项。

二,OpenVINO DL Workbench的使用入门

根据OpenVINO官方文档
参考:https://docs.openvinotoolkit.org/latest/_docs_Workbench_DG_Install_from_Docker_Hub.html#windows

在ubuntu和windows下的操作稍有不同,但大同小异,我以windows为例,

首先,打开powershell 命令窗口,输入命令

docker run -p 127.0.0.1:5665:5665 --name workbench -it openvino/workbench:latest

如果一切正常的话,docker会帮你把文件包从Docker Hub上拉到本地,大概结果如下,

PS C:\Users\space> docker run -p 127.0.0.1:5665:5665 --name workbench  -it openvino/workbench:latest
Unable to find image 'openvino/workbench:latest' locally
latest: Pulling from openvino/workbench
5bed26d33875: Pull complete
f11b29a9c730: Pull complete
930bda195c84: Pull complete
78bf9a5ad49e: Pull complete
。。。这里有好多包,省略
f45b6c5bd647: Pull complete
Digest: sha256:546ffa3ca4469a7b2f2df40da6b7258b997136bef033e183d89f35a99ee0f32a
Status: Downloaded newer image for openvino/workbench:latest
。。。又省略一大段内容
2020-06-19 11:31:40.149 UTC [14] LOG:  redo done at 0/1636940
2020-06-19 11:31:40.149 UTC [14] LOG:  last completed transaction was at log time 2020-06-04 17:02:56.370138+00
2020-06-19 11:31:40.576 UTC [12] LOG:  database system is ready to accept connections
Database is not ready at the moment. Retry in 2 seconds____  __       _       __           __   __                    __/ __ \/ /      | |     / /___  _____/ /__/ /_  ___  ____  _____/ /_/ / / / /       | | /| / / __ \/ ___/ //_/ __ \/ _ \/ __ \/ ___/ __ \/ /_/ / /___     | |/ |/ / /_/ / /  / ,< / /_/ /  __/ / / / /__/ / / /
/_____/_____/     |__/|__/\____/_/  /_/|_/_.___/\___/_/ /_/\___/_/ /_/Generated login token: 9597c742a27299614708b2202ff482338448ba7a72a6661d012592c90ddf22b3DL Workbench is available at: http://127.0.0.1:5665/?token=9597c742a27299614708b2202ff482338448ba7a72a6661d012592c90ddf22b3
[E:] [BSL] found 0 ioexpander device

这时,系统提示你可以进入服务器了,打开浏览器,输入

http://127.0.0.1:5665.

可以看到OpenVINO workbench界面,

在命令窗口按Ctrl + C (事际上我是先后用Ctrl + Z  ---- Ctrl + C)可以停止workbench服务。

然后在命令窗口创建文件夹:
mkdir C:\workbench

根据官网的说法,再运行

docker run -p 127.0.0.1:5665:5665 --name workbench  --volume /C/workbench:/home/openvino/.workbench -d openvino/workbench:latest

报错:冲突,已经在使用中:

PS C:\Users\space> docker run -p 127.0.0.1:5665:5665 --name workbench  --volume /C/workbench:/home/openvino/.workbench -d openvino/workbench:latest
C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from daemon: Conflict. The container name "/workbench" is already in use by container "4e283c7e0bd2397f32ec7413543574d74f55602c913630462c46b121aeba35b4". You have to remove (or rename) that container to be able to reuse that name.
See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'.
PS C:\Users\space>
下面是我的处理方法,

(1)先查看一下当前状态

PS C:\Users\space> docker ps -a
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS                     PORTS                      NAMES
4e283c7e0bd2        openvino/workbench:latest   "bash /opt/intel/ope…"   2 hours ago         Up 2 hours                 127.0.0.1:5665->5665/tcp   workbench
22583a1d1487        ubuntu                      "bash"                   2 hours ago         Exited (127) 2 hours ago                              romantic_cannon
447ed27e3e03        hello-world                 "/hello"                 2 hours ago         Exited (0) 2 hours ago                                trusting_neumann

(2)这时候执行docker rm是不成功的,
PS C:\Users\space> docker rm 4e283c
Error response from daemon: You cannot remove a running container 4e283c7e0bd2397f32ec7413543574d74f55602c913630462c46b121aeba35b4. Stop the container before attempting removal or force remove

(3)这时只能先用docker stop停止服务
PS C:\Users\space> docker stop 4e283c
4e283c

(4)然后再移除该container才可以,
PS C:\Users\space> docker rm 4e283c
4e283c

(5)这样,就可以顺利重新启动container了,

PS C:\Users\space> docker run -p 127.0.0.1:5665:5665 --name workbench  --volume /C/workbench:/home/openvino/.workbench -d openvino/workbench:latest
b26f548fbdca3f6ed2fcb140c438d9cd48f96bb27f07f66e4f09391374db617b

当然,假设不用docker rm的话,用docker start ...也是可以的,官网里并没有具体介绍,我通常就是这么干的。另外,特别注意,那个登陆的token不会再在powershell命令窗口显示,现在已经保存到这里了,

C:\workbench\token.txt

最后,晒一张登陆成功的图片吧!

 

 

这篇关于初试Docker desktop与OpenVINO DL Workbench的使用入门的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!


原文地址:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.chinasem.cn/article/813510

相关文章

C++类和对象之默认成员函数的使用解读

《C++类和对象之默认成员函数的使用解读》:本文主要介绍C++类和对象之默认成员函数的使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、默认成员函数有哪些二、各默认成员函数详解默认构造函数析构函数拷贝构造函数拷贝赋值运算符三、默认成员函数的注意事项总结一

使用Python和Matplotlib实现可视化字体轮廓(从路径数据到矢量图形)

《使用Python和Matplotlib实现可视化字体轮廓(从路径数据到矢量图形)》字体设计和矢量图形处理是编程中一个有趣且实用的领域,通过Python的matplotlib库,我们可以轻松将字体轮廓... 目录背景知识字体轮廓的表示实现步骤1. 安装依赖库2. 准备数据3. 解析路径指令4. 绘制图形关键

详解如何使用Python从零开始构建文本统计模型

《详解如何使用Python从零开始构建文本统计模型》在自然语言处理领域,词汇表构建是文本预处理的关键环节,本文通过Python代码实践,演示如何从原始文本中提取多尺度特征,并通过动态调整机制构建更精确... 目录一、项目背景与核心思想二、核心代码解析1. 数据加载与预处理2. 多尺度字符统计3. 统计结果可

Linux基础命令@grep、wc、管道符的使用详解

《Linux基础命令@grep、wc、管道符的使用详解》:本文主要介绍Linux基础命令@grep、wc、管道符的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录grep概念语法作用演示一演示二演示三,带选项 -nwc概念语法作用wc,不带选项-c,统计字节数-

SpringCloud中的@FeignClient注解使用详解

《SpringCloud中的@FeignClient注解使用详解》在SpringCloud中使用Feign进行服务间的调用时,通常会使用@FeignClient注解来标记Feign客户端接口,这篇文章... 在Spring Cloud中使用Feign进行服务间的调用时,通常会使用@FeignClient注解

Python中OpenCV与Matplotlib的图像操作入门指南

《Python中OpenCV与Matplotlib的图像操作入门指南》:本文主要介绍Python中OpenCV与Matplotlib的图像操作指南,本文通过实例代码给大家介绍的非常详细,对大家的学... 目录一、环境准备二、图像的基本操作1. 图像读取、显示与保存 使用OpenCV操作2. 像素级操作3.

MySQL的ALTER TABLE命令的使用解读

《MySQL的ALTERTABLE命令的使用解读》:本文主要介绍MySQL的ALTERTABLE命令的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1、查看所建表的编China编程码格式2、修改表的编码格式3、修改列队数据类型4、添加列5、修改列的位置5.1、把列

Python使用FFmpeg实现高效音频格式转换工具

《Python使用FFmpeg实现高效音频格式转换工具》在数字音频处理领域,音频格式转换是一项基础但至关重要的功能,本文主要为大家介绍了Python如何使用FFmpeg实现强大功能的图形化音频转换工具... 目录概述功能详解软件效果展示主界面布局转换过程截图完成提示开发步骤详解1. 环境准备2. 项目功能结

SpringBoot使用ffmpeg实现视频压缩

《SpringBoot使用ffmpeg实现视频压缩》FFmpeg是一个开源的跨平台多媒体处理工具集,用于录制,转换,编辑和流式传输音频和视频,本文将使用ffmpeg实现视频压缩功能,有需要的可以参考... 目录核心功能1.格式转换2.编解码3.音视频处理4.流媒体支持5.滤镜(Filter)安装配置linu

Redis中的Lettuce使用详解

《Redis中的Lettuce使用详解》Lettuce是一个高级的、线程安全的Redis客户端,用于与Redis数据库交互,Lettuce是一个功能强大、使用方便的Redis客户端,适用于各种规模的J... 目录简介特点连接池连接池特点连接池管理连接池优势连接池配置参数监控常用监控工具通过JMX监控通过Pr