楼主: kychan
3617 25

【Sébastien Goasguen】Docker Cookbook [推广有奖]

11
Lisrelchen 发表于 2015-8-18 12:11:44

12
chenyi112982 发表于 2015-8-18 12:31:21
又一本COOKBOOK
海底游的
好书!

13
kaixin1018 在职认证  发表于 2015-8-18 15:18:31
简单的事重复做,你就是专家;重复的事用心做,你就是赢家。

14
songlinjl 发表于 2015-8-18 19:41:28
nan'an'an'an'an'an'an'an

15
Elena3 发表于 2015-8-18 23:09:00

16
soccy 发表于 2015-8-25 07:57:40
......

17
totdsg 发表于 2015-9-4 11:18:29
xiexie..................

18
qdlts1 发表于 2015-9-12 10:52:21
thanks for the sharing

19
吕涛 发表于 2016-8-27 07:25:29
  1. 2.1 Keeping Changes Made to a Container by Committing
  2. to an Image
  3. Problem
  4. After making some changes inside a container, you decide that you would like to keep
  5. those changes. You do not want to lose those changes after you exit or stop the container,
  6. and you would like to reuse this type of container as a basis for others.
  7. Solution
  8. Commit the changes that you made by using the docker commit command and
  9. define a new image.
  10. Let’s start a container with an interactive bash shell and update the packages in it:
  11. $ docker run -t -i ubuntu:14.04 /bin/bash
  12. root@69079aaaaab1:/# apt-get update
  13. When you exit the container, it stops running, but it is still available to you until you
  14. remove it entirely with docker rm. So before you do this, you can commit the
  15. changes made to the container and create a new image, ubuntu:update. The name of
  16. the image is ubuntu, and you add the tag update (see Recipe 2.6) to mark the difference
  17. from the ubuntu:latest image:
  18. $ docker commit 69079aaaaab1 ubuntu:update
  19. 13132d42da3cc40e8d8b4601a7e2f4dbf198e9d72e37e19ee1986c280ffcb97c
  20. $ docker images
  21. REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
  22. ubuntu update 13132d42da3c 5 days ago 213 MB
复制代码

20
吕涛 发表于 2016-8-27 07:26:31
  1. 2.2 Saving Images and Containers as Tar Files for Sharing
  2. Problem
  3. You have created images or have containers that you would like to keep and share
  4. with your collaborators.
  5. Solution
  6. Use the Docker CLI save and load commands to create a tarball from a previously
  7. created image, or use the Docker CLI import and export commands for containers.
  8. Let’s start with a stop container and export it to a new tarball:
  9. $ docker ps -a
  10. CONTAINER ID IMAGE COMMAND CREATED ... NAMES
  11. 77d9619a7a71 ubuntu:14.04 "/bin/bash" 10 seconds ago ... high_shockley
  12. $ docker export 77d9619a7a71 > update.tar
  13. $ ls
  14. update.tar
复制代码

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-25 20:04