楚阿旗

博客园 首页 新随笔 联系 订阅 管理

Docker objects

  • Dockerfile
    • A dockerfile is a editable text file that contains instructions needed to create an image in terminal.
    • The instructions docker provided:
      • FROM: Defines base image
      • RUN: Executes arbitrary commands
      • CMD: Defines default command for container execution
  • Image
    • Use for createing Docker containers and Read-only template with instructions
    • Built using instructions in a Dockerfie; a new read-only image layer is creaed for each instruction
    • A writeable layer is added when an image layer is created for each instruction
    • Layers can be shared between images, which saves disk space and network bandwidth
    • image naming: hostname/repository:tag, dockr.io/ubuntu:18.04
  • Container
    • arunnable instance of an image
    • Can be created, stopped, started or deleted using the Docker API or CLI
    • Can connect to multiple networks, attach storage, or create a new image based on its current state
    • Is well isolated from othe containers and its host machine
  • Network: Networks are used for the isolated container communication
  • Storage: Docker uses volumes and bind mounts to persist data even after a container stops
  • Other objects Plugins Add-ons: Storage plugins provide the ability to connect to external stroage platforms
posted on 2024-03-22 15:00  楚阿旗  阅读(24)  评论(0)    收藏  举报