[13th][Day13] docker file

相较於用 docker commit ,比较多人是使用 『Dockerfile』来建立 image

A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image

https://docs.docker.com/engine/reference/builder/
Dockerfile 是一个文字档,包含所有的命令,让使用者在 command line 中组成自己的 image

建一个资料夹 建一个 Dockerfile
这个资料夹就是 image 的 build environment
本资料夹中的所有档案会随着上传到 daemon

编辑你的 Dockerfile
https://ithelp.ithome.com.tw/upload/images/20210921/20119546V6u3g8477A.png

  • Docker 从 basic image 运行一个 container
  • 执行一条 cmd ,对 container 修改
  • 执行类似 docker commit 的操作,提交一个新的 image layer
  • 基於刚刚提交的 image 运作一个 new container
  • 执行下一条 cmd ,直到所有 cmd 都执行完毕
docker build [OPTIONS] PATH | URL | -
docker build -t="eric211924/try_dockerfile" .

https://ithelp.ithome.com.tw/upload/images/20210921/201195467MbQBv3OGy.png

debug your Dockerfile , 直到 build 成功为止
https://ithelp.ithome.com.tw/upload/images/20210921/20119546bpEFnKWxlZ.png

run 一个 container from 自己 build 出来的 image

https://ithelp.ithome.com.tw/upload/images/20210921/20119546Gm4LXWOIPW.png


<<:  【Day21】补上data-test属性及判断Component和按钮及数字是否正确显示(╯✧∇✧)╯

>>:  Day06 Flutter 启动流程

我们的基因体时代-AI, Data和生物资讯 Day28-COVID大数据:资料哪里来

上一篇我们的基因体时代-AI, Data和生物资讯 Day27-进阶人工智慧在分子生物学之应用又是明...

[Day6] Face Detection - 使用Google ML Kit (iOS)

昨天是使用Android平台来作开发,当然不可少iOS平台罗! 有人给你了apk(Android),...

Day19 - 中场休息时间 - 怎麽样用Canvas精准的写出一个『字』 - 成为Canvas Ninja ~ 理解2D渲染的精髓

呃,首先呢~ 敝人小弟在下我今天仔细的思考了一下,决定这次还是再来一篇『中场休息』科普文,等到明天再...

IKE与ISAKMP

Internet金钥交换(IKE)是IPsec的关键体系结构组件。 它用於执行相互身份验证以及建立...

Day 24【Random Picture Blending in Python】return bool;

【前言】 在 Project 之中刚好有一份工作是要把每个部件合成,虽然跟主题没有关联不过因为篇幅...