【VMCloud云平台】拥抱Docker(五)Volume(1)

在上一篇中,我们讲到了如何配置多个容器并且定制属于自己的镜像,但是容器的数据性能以及持久如何保证的?本篇将通过介绍Docker Volume来说明这个问题,涉及到的架构如下图所示:

image

1、 说到Volume实际上有多种方式可以实现,第一种方式为采用Dockerfile,但这种方式要找到对应的volume存放在主机哪里比较麻烦。首先我们查找我们存在哪些images:

image

2、 然后我们写一个dockerfile,并在其中指定Volume:

image

3、 接着我们使用docker file构建镜像(关于Dockerfile后面有讲到):

image

4、 这时我们就创建起一个带有Volume的基础镜像,而基于这个基础镜像所创建的容器都会有一个/VMCTest的挂载点,我们可以测试创建一个容器:

image

5、 我们来看下是否存在一个/VMCTest挂载点,我们创建一个文件以作测试:

image

image

6、 那么这个VMCTest究竟存在哪里的呢?我们可以通过以下命令来查看实际位置:

image

7、可以看到实际的映射位置,我们可以进入到该路径看下,刚刚创建的测试文件在不在:

image

8、OK,关于数据卷的第一种用法,我们就介绍到这里,下一篇我们将介绍另外一种更加暴力的挂载方式。


image

  1. nilfortuneonline说道:

    Nilfortuneonline info site seems legit. I'm digging the layout! Quick access to links and information. Might just be my new go-to spot. Check it out for yourself: nilfortuneonline

  2. pklucky93game说道:

    I felt like I had some real luck today! The platform is very user-friendly even for beginners. I will definitely be returning to pklucky93game very soon.

  3. inyes365说道:

    The registration process was so simple and I was playing within minutes. Really love the layout of inyes365.

  4. gb777game说道:

    Solid platform with a fair chance of winning. I've tried a few others but this one feels the most honest. gb777game

  5. winstoriacasino说道:

    Every time I log in I find something new and exciting to play. The loyalty rewards keep me coming back for more. I always suggest winstoriacasino to my friends.

  6. bet5777login说道:

    Super impressed with the bonuses offered on this site. It really gives you a head start. I'm really enjoying my time on bet5777login.

  7. br456bt说道:

    Really impressed with the variety of games available. Everything loads fast and the graphics are top notch. Glad I found br456bt.

  8. batak5dslot说道:

    The slot variety here is insane. I tried a few different games and the graphics are top notch. It feels very lucky today. Give batak5dslot a try

  9. idzoom188说道:

    The customer support is top-notch and they solved my issue in minutes. It's hard to find such professional service these days. Love idzoom188.

  10. okadaplayapp说道:

    The app experience is just top notch. It is so much more convenient than using a browser. Definitely download okadaplayapp if you want to play on the go.

  11. 991jililink说道:

    Super easy access and the loading speed is impressive. I love how everything is organized, making it easy to find my favorite games. Great vibes over at 991jililink.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注