九色国产,午夜在线视频,新黄色网址,九九色综合,天天做夜夜做久久做狠狠,天天躁夜夜躁狠狠躁2021a,久久不卡一区二区三区

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
docker鏡像的導(dǎo)入和導(dǎo)出,容器修改提交鏡像

gitlab 的docker使用

gitlab docker 

啟動(dòng)命令

docker run -d -p 3000:80 twang2218/gitlab-ce-zh:9.0.3docker run -d -p 8080:80 gitlab/gitlab-ce:latest
  • 1
  • 2
  • 3
  • 4
  • 5

將容器修改提交到鏡像

# 進(jìn)入容器內(nèi)部[root@#localhost docker]# docker run -ti  ubuntu:14.04 /bin/bashroot@812a997f614a:/# id uid=0(root) gid=0(root) groups=0(root)#做了一些修改root@812a997f614a:/# echo update>update.txtroot@812a997f614a:/# exitexit[root@#localhost docker]# docker ps -aCONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS                           PORTS                                   NAMES812a997f614a        ubuntu:14.04                   "/bin/bash"              7 minutes ago       Exited (0) 22 seconds ago                                                zealous_euler69304dea46c7        gitlab/gitlab-ce:latest        "/assets/wrapper"        About an hour ago   Exited (127) 44 minutes ago                                              competent_minsky67ba866e21b0        gitlab/gitlab-ce:latest        "/assets/wrapper"        2 hours ago         Exited (137) About an hour ago                                           hungry_hoover2a3d08a0a2ff        twang2218/gitlab-ce-zh:9.0.3   "/assets/wrapper"        2 hours ago         Exited (137) About an hour ago                                           nervous_wozniak6db49540be99        twang2218/gitlab-ce-zh:9.0.3   "/assets/wrapper"        2 hours ago         Exited (255) 2 hours ago         22/tcp, 443/tcp, 0.0.0.0:3000->80/tcp   romantic_elionb08a6d6ed716        gitlab/gitlab-ce:latest        "/assets/wrapper"        2 hours ago         Exited (255) 2 hours ago         22/tcp, 443/tcp, 0.0.0.0:8080->80/tcp   competent_brahmagupta33fd0b1ebd27        gitlab/gitlab-ce:latest        "/assets/wrapper"        2 hours ago         Exited (127) 2 hours ago                                                 loving_brattain6f53620a930c        twang2218/gitlab-ce-zh:9.0.3   "/assets/wrapper"        3 hours ago         Exited (127) 2 hours ago                                                 brave_galileo88df78f77c4e        ubuntu:14.04                   "sleep 360"              4 days ago          Exited (137) 4 days ago                                                  testcopy81a879a36bd3        wordpress                      "docker-entrypoint..."   4 days ago          Exited (0) 4 days ago                                                    wordpressa57a3cc492b7        mysql                          "docker-entrypoint..."   4 days ago          Exited (0) 4 days ago                                                    mysqlwp# 將修改多的鏡像保存成一個(gè)新的[root@#localhost docker]# docker commit 812a997f614a ubuntu:updatesha256:317f102584605694da424bc96764559a1ccfda13943353f4cbdfd89c96515e6b[root@#localhost docker]# docker imagesREPOSITORY                  TAG                 IMAGE ID            CREATED             SIZEubuntu                      update              317f10258460        5 seconds ago       188 MBtwang2218/gitlab-ce-zh      9.0.3               36172b5fefab        44 hours ago        1.19 GBgitlab/gitlab-ce            latest              5eff2e44957c        2 days ago          1.11 GBmysql                       latest              9546ca122d3a        8 days ago          407 MBwordpress                   latest              4ad41adc2794        2 weeks ago         401 MBubuntu                      14.04               7c09e61e9035        5 weeks ago         188 MBdaocloud.io/library/nginx   1.7.1               e3e043d3ed2f        2 years ago         499 MB# 查看修改多的鏡像和原來(lái)鏡像之間的差異[root@#localhost docker]# docker diff 812a997f614aC /varC /var/cacheC /var/cache/aptD /var/cache/apt/srcpkgcache.binD /var/cache/apt/pkgcache.binC /var/libC /var/lib/aptC /var/lib/apt/listsA /var/lib/apt/lists/lockA /var/lib/apt/lists/partialA /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_trusty-updates_InReleaseA /update.txtC /rootA /root/.bash_history[root@#localhost docker]# 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59

鏡像的導(dǎo)入和導(dǎo)出

export 和improt

[root@#localhost docker]# docker run -ti  ubuntu:update /bin/bashroot@cbe3cb7799ed:/# lsbin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  update.txt  usr  var[root@#localhost docker]# [root@#localhost docker]# docker ps -aCONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS                        PORTS                                   NAMEScbe3cb7799ed        ubuntu:update                  "/bin/bash"              47 seconds ago      Exited (1) 6 seconds ago                                              adoring_kare812a997f614a        ubuntu:14.04                   "/bin/bash"              16 minutes ago      Exited (0) 8 minutes ago                                              zealous_euler69304dea46c7        gitlab/gitlab-ce:latest        "/assets/wrapper"        2 hours ago         Exited (127) 53 minutes ago                                           competent_minsky67ba866e21b0        gitlab/gitlab-ce:latest        "/assets/wrapper"        2 hours ago         Exited (137) 2 hours ago                                              hungry_hoover2a3d08a0a2ff        twang2218/gitlab-ce-zh:9.0.3   "/assets/wrapper"        2 hours ago         Exited (137) 2 hours ago                                              nervous_wozniak6db49540be99        twang2218/gitlab-ce-zh:9.0.3   "/assets/wrapper"        2 hours ago         Exited (255) 2 hours ago      22/tcp, 443/tcp, 0.0.0.0:3000->80/tcp   romantic_elionb08a6d6ed716        gitlab/gitlab-ce:latest        "/assets/wrapper"        2 hours ago         Exited (255) 2 hours ago      22/tcp, 443/tcp, 0.0.0.0:8080->80/tcp   competent_brahmagupta33fd0b1ebd27        gitlab/gitlab-ce:latest        "/assets/wrapper"        3 hours ago         Exited (127) 2 hours ago                                              loving_brattain6f53620a930c        twang2218/gitlab-ce-zh:9.0.3   "/assets/wrapper"        3 hours ago         Exited (127) 2 hours ago                                              brave_galileo88df78f77c4e        ubuntu:14.04                   "sleep 360"              4 days ago          Exited (137) 4 days ago                                               testcopy81a879a36bd3        wordpress                      "docker-entrypoint..."   4 days ago          Exited (0) 4 days ago                                                 wordpressa57a3cc492b7        mysql                          "docker-entrypoint..."   4 days ago          Exited (0) 4 days ago                                                 mysqlwp# 將鏡像導(dǎo)出到文件[root@#localhost docker]# docker export cbe3cb7799ed > update.tar# 創(chuàng)建一個(gè)新靜像從基于導(dǎo)出的文件[root@#localhost /]# docker import - update < update.tar sha256:fd00d520a43eb5dc6cca8717fe0ca04cfdc53b02cad2fb5b50d877b8e6d6c3bc[root@#localhost /]# docker imagesREPOSITORY                  TAG                 IMAGE ID            CREATED             SIZEupdate                      latest              fd00d520a43e        13 seconds ago      165 MBubuntu                      update              317f10258460        11 minutes ago      188 MBtwang2218/gitlab-ce-zh      9.0.3               36172b5fefab        44 hours ago        1.19 GBgitlab/gitlab-ce            latest              5eff2e44957c        2 days ago          1.11 GBmysql                       latest              9546ca122d3a        8 days ago          407 MBwordpress                   latest              4ad41adc2794        2 weeks ago         401 MBubuntu                      14.04               7c09e61e9035        5 weeks ago         188 MBdaocloud.io/library/nginx   1.7.1               e3e043d3ed2f        2 years ago         499 MB[root@#localhost /]# 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40

save 和load

(像當(dāng)與鏡像的備份和恢復(fù))

# update是一個(gè)已經(jīng)存在的鏡像[root@#localhost /]# docker save -o update1.tar update[root@#localhost /]# lsbin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  update1.tar  update.tar  usr  var[root@#localhost /]# du -sh update1.tar 166M    update1.tar# 刪除update鏡像[root@#localhost /]# docker rmi updateUntagged: update:latestDeleted: sha256:fd00d520a43eb5dc6cca8717fe0ca04cfdc53b02cad2fb5b50d877b8e6d6c3bcDeleted: sha256:14cc8cd7b783152682835346e5fe90860a9feeb684866688692285319d4e97ad[root@#localhost /]# docker imagesREPOSITORY                  TAG                 IMAGE ID            CREATED             SIZEubuntu                      update              317f10258460        16 minutes ago      188 MBtwang2218/gitlab-ce-zh      9.0.3               36172b5fefab        44 hours ago        1.19 GBgitlab/gitlab-ce            latest              5eff2e44957c        2 days ago          1.11 GBmysql                       latest              9546ca122d3a        8 days ago          407 MBwordpress                   latest              4ad41adc2794        2 weeks ago         401 MBubuntu                      14.04               7c09e61e9035        5 weeks ago         188 MBdaocloud.io/library/nginx   1.7.1               e3e043d3ed2f        2 years ago         499 MB#導(dǎo)入鏡像[root@#localhost /]# docker load < update1.tar 14cc8cd7b783: Loading layer [==================================================>] 173.8 MB/173.8 MBLoaded image: update:latest[root@#localhost /]# docker imagesREPOSITORY                  TAG                 IMAGE ID            CREATED             SIZEupdate                      latest              fd00d520a43e        6 minutes ago       165 MBubuntu                      update              317f10258460        17 minutes ago      188 MBtwang2218/gitlab-ce-zh      9.0.3               36172b5fefab        44 hours ago        1.19 GBgitlab/gitlab-ce            latest              5eff2e44957c        2 days ago          1.11 GBmysql                       latest              9546ca122d3a        8 days ago          407 MBwordpress                   latest              4ad41adc2794        2 weeks ago         401 MBubuntu                      14.04               7c09e61e9035        5 weeks ago         188 MBdaocloud.io/library/nginx   1.7.1               e3e043d3ed2f        2 years ago         499 MB[root@#localhost /]# 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39

Dockerfile

[root@#localhost ~]# mkdir docker_file[root@#localhost ~]# cd docker_file/[root@#localhost docker_file]# vi Dockerfile [root@#localhost docker_file]# cat Dockerfile FROM ubuntu:14.04ENTRYPOINT ["/bin/echo"][root@#localhost docker_file]# docker build .Sending build context to Docker daemon 2.048 kBStep 1/2 : FROM ubuntu:14.04 ---> 7c09e61e9035Step 2/2 : ENTRYPOINT /bin/echo ---> Running in d53f31b93355 ---> 26dd06d2e5a5Removing intermediate container d53f31b93355Successfully built 26dd06d2e5a5#運(yùn)行鏡像[root@#localhost docker_file]# docker run 26dd06d2e5a5#加入一個(gè)參數(shù)[root@#localhost docker_file]# docker run 26dd06d2e5a5 hello worldhello world[root@#localhost docker_file]# vi Dockerfile [root@#localhost docker_file]# docker run 26dd06d2e5a5 hello worldhello world#[root@#localhost docker_file]# cat Dockerfile FROM ubuntu:14.04#ENTRYPOINT ["/bin/echo","Hi world!"]CMD ["/bin/echo","Hi world!"][root@#localhost docker_file]# docker build .[root@#localhost docker_file]# docker run 12458a717cedHi world![root@#localhost docker_file]# docker run 12458a717ced /bin/date Sat Apr  8 12:08:14 UTC 2017
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51

構(gòu)建的時(shí)候打個(gè)標(biāo)簽

[root@#localhost docker_file]# docker build -t yang:01 .Sending build context to Docker daemon 3.584 kBStep 1/2 : FROM ubuntu:14.04 ---> 7c09e61e9035Step 2/2 : CMD /bin/echo Hi world! ---> Running in 94e510f085d7 ---> 6b33c8a6a32fRemoving intermediate container 94e510f085d7Successfully built 6b33c8a6a32f[root@#localhost docker_file]# docker imagesREPOSITORY                  TAG                 IMAGE ID            CREATED             SIZEyang                        01                  6b33c8a6a32f        5 seconds ago       188 MBupdate                      latest              fd00d520a43e        29 minutes ago      165 MBubuntu                      update              317f10258460        41 minutes ago      188 MBtwang2218/gitlab-ce-zh      9.0.3               36172b5fefab        44 hours ago        1.19 GBgitlab/gitlab-ce            latest              5eff2e44957c        2 days ago          1.11 GBmysql                       latest              9546ca122d3a        8 days ago          407 MBwordpress                   latest              4ad41adc2794        2 weeks ago         401 MBubuntu                      14.04               7c09e61e9035        5 weeks ago         188 MBdaocloud.io/library/nginx   1.7.1               e3e043d3ed2f        2 years ago         499 MB[root@#localhost docker_file]# 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

構(gòu)建實(shí)例

將flask應(yīng)用 打包的鏡像中

編寫(xiě)python程序 hellp.py

#!/usr/bin/env pythonfrom flask import Flaskapp = Flask(__name__)@app.route('/hi')def hello_world():    return 'Hello World!'if __name__ == '__main__':    app.run(host='0.0.0.0', port=5000)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

編寫(xiě)Dockerfile

FROM ubuntu:14.04RUN apt-get updateRUN apt-get install -y pythonRUN apt-get install -y python-pipRUN apt-get clean allRUN pip install flaskADD hello.py /tmp/hello.pyEXPOSE 5000CMD ["python","/tmp/hello.py"]
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
docker學(xué)習(xí)2-快速搭建centos7-python3.6環(huán)境
Docker退出容器不關(guān)閉容器的方法
docker(1) 三劍客 docker
Docker容器學(xué)習(xí)梳理--基礎(chǔ)知識(shí)(1)
Docker容器技術(shù)入門(一)
【云原生】第十一篇
更多類似文章 >>
生活服務(wù)
熱點(diǎn)新聞
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服