Docker and VirtualBox(2)Set up Docker on VMs
1 Set up Shared Disk
I have a ubuntu-master, ubuntu-dev1, ubuntu-dev2 and all of them will share a disk named share1.
> VBoxManage modifymedium --type shareable share1.vdi
Init the disk in VM
> sudo fdisk /dev/sdb
>m >n >p >1 finally >w
> sudo fdisk -l
Device Boot Start End Blocks Id System
/dev/sdb1 2048 41943039 20970496 83 Linux
Create directory
> sudo mkdir /mnt/share1
Mount the disk
> sudo mount -t auto /dev/sdb1 /mnt/share1
mount: you must specify the filesystem type
Solution:
It seems wrong to me, Device Boot Type.
Format that to ext3
> sudo mkfs -t ext3 /dev/sdb1
Set up Auto Amount
> ls -l /dev/disk/by-uuid
3d75cf25-76cb-4ddb-a74d-be1449aa78ee -> ../../sdb1
> sudo vi /etc/fstab
UUID=3d75cf25-76cb-4ddb-a74d-be1449aa78ee /mnt/share1 auto defaults 0 0
> sudo mount -a
> df -hl
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 386M 492K 386M 1% /run
/dev/sda1 75G 2.2G 69G 4% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 1.9G 0 1.9G 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/sdb1 20G 45M 19G 1% /mnt/share1
Do the same things on all 3 machines.
2 Set up Docker Configuration
> sudo curl -sSL https://get.docker.com/ | sh
> sudo usermod -aG docker carl
Create directory and change Docker Config
> sudo mkdir /mnt/share1/docker
> sudo vi /etc/default/docker
DOCKER_OPTS="-g /mnt/share1/docker"
Restart the server and check
> sudo service docker restart
We can check the docker info and df -hl check the file system.
It works pretty well on ubuntu VM.
References:
http://sillycat.iteye.com/blog/2263719
http://sillycat.iteye.com/blog/2254550
分享到:
相关推荐
自制Docker Virtualbox 该公式解决了基于AMD的MacOS(Ryzentosh)上的Docker问题。 也可以在任何Mac上使用。 安装 从Oracle网站安装Virtualbox 。 请不要忘记删除所有以前的安装。 通过Homebrew安装docker-...
关于Docker和虚拟机性能的对比测试。
Continuous Delivery with Docker and Jenkins Delivering software at scale 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有...
Continuous Delivery with Docker and Jenkins 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有...
deeper coverage of Docker Swarm mode, introductions to both Kubernetes and AWS Fargate, examples on how to optimize your Docker images, and much more. Learn how Docker simplifies dependency ...
Continuous Delivery with Docker and Jenkins 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
Run Docker on AWS and build real-world, secure, and scalable container platforms on cloud Key Features Configure Docker for the ECS environment Integrate Docker with different AWS tools Implement ...
Docker and Kubernetes for Java Developers 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除
Learn how to run new and old applications in Docker containers on Windows - modernizing the architecture, improving security and maximizing efficiency.
[eBook] Continuous Delivery with Docker and Jenkins Delivering software at scale. ISBN: 1787125238, 9781787125230 (2017)
With this practical guide, you’ll learn how to use Docker to package your applications with all of their dependencies, and then test, ship, scale, and support your containers in production. ...
What You Will LearnComprehend key Docker concepts: images, containers, registries, and swarmsRun Docker on Windows 10, Windows Server 2016, and in the cloudDeploy and monitor distributed solutions ...
Moving on, we'll cover the practical usage of Docker and the tools in the Docker ecosystem, such as Docker Compose, Docker Trusted Registry, and Docker Swarm Mode. Then, you'll be able to apply that ...
离线环境下,在centos7.6系统上安装docker-ce-19.03,nvidia-docker2.4版本,其中docker-ce-19.03在docker-local.tar压缩文件里面,nvidia-docker2在nvidia-docker2.zip文件中。 具体安装流程如下: 1.安装docker ...
**Boot2Docker ISO的v18.02.0-ce版本详解** Boot2Docker是一款轻量级的Linux发行版,专为在Docker容器上运行而设计。它的主要目的是提供一个简单、快速的方式来运行Docker主机,尤其适合开发者在本地环境中进行...
Imagine creating and testing Java EE applications on Apache Tomcat or Wildfly in minutes, along with deploying and managing Java applications swiftly. Sounds too good to be true? You have a reason to ...