AI智能体研发之路-工程篇(一):Docker助力AI智能体开发提效

简介: AI智能体研发之路-工程篇(一):Docker助力AI智能体开发提效

一、引言

由于近两年云原生热,大家对docker、docker compose及k8s或多或少都有一些涉猎,即便没有实际应用肯定也耳熟能详,今天对docker及docker compose的命令集进行梳理,大家可以收藏以便之后快速查阅。

二、docker常用命令

Common Commands(常用命令):

  •  run         Create and run a new container from an image(从一个image镜像创建并启动一个新的container容器)
  •  exec        Execute a command in a running container(在一个运行的container容器执行一段命令)
  •  ps          List containers(列出container容器,-a列出全部容器,不加-a列出运行的容器)
  •  build       Build an image from a Dockerfile(从Dockerfile配置文件创建一个image镜像)
  •  pull        Download an image from a registry(从dockerhub等资源库下载一个image镜像)
  •  push        Upload an image to a registry(推送一个镜像至资源库)
  •  images      List images(列出images镜像)
  •  login       Log in to a registry(登陆进一个资源库)
  •  logout      Log out from a registry(从资源库推出)
  •  search      Search Docker Hub for images(从dockerhub中搜索images镜像)
  •  version     Show the Docker version information(看docker的版本信息)
  •  info        Display system-wide information(查看docker附带的插件信息)

Commands:

  •  attach      Attach local standard input, output, and error streams to a running container()
  •  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
  •  export      Export a container's filesystem as a tar archive
  •  history     Show the history of an image
  •  import      Import the contents from a tarball to create a filesystem image
  •  inspect     Return low-level information on Docker objects(返回container或images的元数据)
  •  kill        Kill one or more running containers(杀死一个或更多个运行的container容器)
  •  load        Load an image from a tar archive or STDIN
  •  logs        Fetch the logs of a container(取出container容器运行日志)
  •  pause       Pause all processes within one or more containers
  •  port        List port mappings or a specific mapping for the container列出容器与宿主机的映射关系
  •  rename      Rename a container(重命名一个容器)
  •  restart     Restart one or more containers(重启一个或更多个container容器)
  •  rm          Remove one or more containers(删除一个或更多个container容器)
  •  rmi         Remove one or more images(删除一个或更多个image镜像)
  •  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  •  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(对二次开发的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(更新一个或更多容器的配置)
  •  wait        Block until one or more containers stop, then print their exit codes

Management Commands(管理命令):

  •  builder     Manage builds
  •  buildx*     Docker Buildx (Docker Inc., v0.11.0)
  •  checkpoint  Manage checkpoints
  •  compose*    Docker Compose (Docker Inc., v2.19.1)
  •  container   Manage containers
  •  context     Manage contexts
  •  dev*        Docker Dev Environments (Docker Inc., v0.1.0)
  •  extension*  Manages Docker extensions (Docker Inc., v0.2.20)
  •  image       Manage images
  •  init*       Creates Docker-related starter files for your project (Docker Inc., v0.1.0-beta.6)
  •  manifest    Manage Docker image manifests and manifest lists
  •  network     Manage networks
  •  plugin      Manage plugins
  •  sbom*       View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  •  scan*       Docker Scan (Docker Inc., v0.26.0)
  •  scout*      Command line tool for Docker Scout (Docker Inc., 0.16.1)
  •  system      Manage Docker
  •  trust       Manage trust on Docker images
  •  volume      Manage volumes

Swarm Commands:

  •  config      Manage Swarm configs
  •  node        Manage Swarm nodes
  •  secret      Manage Swarm secrets
  •  service     Manage Swarm services
  •  stack       Manage Swarm stacks
  •  swarm       Manage Swarm

Global Options:

  • --config string      Location of client config files (default "/Users/daoguang1/.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 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 "/Users/daoguang1/.docker/ca.pem")
  • --tlscert string     Path to TLS certificate file (default "/Users/daoguang1/.docker/cert.pem")
  • --tlskey string      Path to TLS key file (default "/Users/daoguang1/.docker/key.pem")
  • --tlsverify          Use TLS and verify the remote
  • -v, --version            Print version information and quit

三、docker compose常用命令

Commands(命令):

  •  build       Build or rebuild services
  •  config      Parse, resolve and render compose file in canonical format
  •  cp          Copy files/folders between a service container and the local filesystem
  •  create      Creates containers for a service.
  •  down        Stop and remove containers, networks
  •  events      Receive real time events from containers.
  •  exec        Execute a command in a running container.
  •  images      List images used by the created containers
  •  kill        Force stop service containers.
  •  logs        View output from containers
  •  ls          List running compose projects
  •  pause       Pause services
  •  port        Print the public port for a port binding.
  •  ps          List containers
  •  pull        Pull service images
  •  push        Push service images
  •  restart     Restart service containers
  •  rm          Removes stopped service containers
  •  run         Run a one-off command on a service.
  •  start       Start services
  •  stop        Stop services
  •  top         Display the running processes 列出容器组合中每个容器的进程,需要在docker-compose.yaml所在目录执行
  •  unpause     Unpause services
  •  up          Create and start containers 创建或启动容器组合,需要在docker-compose.yaml所在目录执行
  •  version     Show the Docker Compose version information 展示docker compose版本

Options(配置):

  •      --ansi string                Control when to print ANSI control characters ("never"|"always"|"auto") (default "auto")
  •      --compatibility              Run compose in backward compatibility mode
  •      --dry-run                    Execute command in dry run mode
  •      --env-file stringArray       Specify an alternate environment file.
  •  -f, --file stringArray           Compose configuration files
  •      --parallel int               Control max parallelism, -1 for unlimited (default -1)
  •      --profile stringArray        Specify a profile to enable
  •      --progress string            Set type of progress output (auto, tty, plain, quiet) (default "auto")
  •      --project-directory string   Specify an alternate working directory
  •                                   (default: the path of the, first specified, Compose file)
  •  -p, --project-name string        Project name

四、总结

现在不仅AI厂商卷,开源项目也卷的要命,基本上所有的开源项目都会将镜像上传至dockerhub,并且支持docker或者docker compose的一键部署,收藏一份命令集,随时用随时找。


目录
相关文章
|
4月前
|
人工智能 测试技术 API
构建AI智能体:二、DeepSeek的Ollama部署FastAPI封装调用
本文介绍如何通过Ollama本地部署DeepSeek大模型,结合FastAPI实现API接口调用。涵盖Ollama安装、路径迁移、模型下载运行及REST API封装全过程,助力快速构建可扩展的AI应用服务。
1293 6
|
4月前
|
人工智能 API 开发工具
构建AI智能体:一、初识AI大模型与API调用
本文介绍大模型基础知识及API调用方法,涵盖阿里云百炼平台密钥申请、DashScope SDK使用、Python调用示例(如文本情感分析、图像文字识别),助力开发者快速上手大模型应用开发。
1811 16
构建AI智能体:一、初识AI大模型与API调用
|
4月前
|
存储 机器学习/深度学习 人工智能
构建AI智能体:三、Prompt提示词工程:几句话让AI秒懂你心
本文深入浅出地讲解Prompt原理及其与大模型的关系,系统介绍Prompt的核心要素、编写原则与应用场景,帮助用户通过精准指令提升AI交互效率,释放大模型潜能。
822 5
|
4月前
|
消息中间件 人工智能 安全
云原生进化论:加速构建 AI 应用
本文将和大家分享过去一年在支持企业构建 AI 应用过程的一些实践和思考。
1081 50
|
5月前
|
人工智能 安全 中间件
阿里云 AI 中间件重磅发布,打通 AI 应用落地“最后一公里”
9 月 26 日,2025 云栖大会 AI 中间件:AI 时代的中间件技术演进与创新实践论坛上,阿里云智能集团资深技术专家林清山发表主题演讲《未来已来:下一代 AI 中间件重磅发布,解锁 AI 应用架构新范式》,重磅发布阿里云 AI 中间件,提供面向分布式多 Agent 架构的基座,包括:AgentScope-Java(兼容 Spring AI Alibaba 生态),AI MQ(基于Apache RocketMQ 的 AI 能力升级),AI 网关 Higress,AI 注册与配置中心 Nacos,以及覆盖模型与算力的 AI 可观测体系。
1182 59
|
4月前
|
人工智能 运维 Kubernetes
Serverless 应用引擎 SAE:为传统应用托底,为 AI 创新加速
在容器技术持续演进与 AI 全面爆发的当下,企业既要稳健托管传统业务,又要高效落地 AI 创新,如何在复杂的基础设施与频繁的版本变化中保持敏捷、稳定与低成本,成了所有技术团队的共同挑战。阿里云 Serverless 应用引擎(SAE)正是为应对这一时代挑战而生的破局者,SAE 以“免运维、强稳定、极致降本”为核心,通过一站式的应用级托管能力,同时支撑传统应用与 AI 应用,让企业把更多精力投入到业务创新。
595 30
|
4月前
|
设计模式 人工智能 自然语言处理
3个月圈粉百万,这个AI应用在海外火了
不知道大家还记不记得,我之前推荐过一个叫 Agnes 的 AI 应用,也是当时在 WAIC 了解到的。
582 1
|
4月前
|
存储 人工智能 NoSQL
AI大模型应用实践 八:如何通过RAG数据库实现大模型的私有化定制与优化
RAG技术通过融合外部知识库与大模型,实现知识动态更新与私有化定制,解决大模型知识固化、幻觉及数据安全难题。本文详解RAG原理、数据库选型(向量库、图库、知识图谱、混合架构)及应用场景,助力企业高效构建安全、可解释的智能系统。
|
4月前
|
人工智能 算法 Java
Java与AI驱动区块链:构建智能合约与去中心化AI应用
区块链技术和人工智能的融合正在开创去中心化智能应用的新纪元。本文深入探讨如何使用Java构建AI驱动的区块链应用,涵盖智能合约开发、去中心化AI模型训练与推理、数据隐私保护以及通证经济激励等核心主题。我们将完整展示从区块链基础集成、智能合约编写、AI模型上链到去中心化应用(DApp)开发的全流程,为构建下一代可信、透明的智能去中心化系统提供完整技术方案。
369 3

热门文章

最新文章