官术网_书友最值得收藏!

Docker

Once the environment is set, it is time to install the services and the software that we need. This can be done using Docker, a simple and portable way to ship and run many applications and services in isolated containers. We will use it to install the required databases, web servers, and all the other applications required throughout this book, in a virtual machine created using Vagrant. In fact, the Vagrant VM that was previously created already has an example of getting an instance of MongoDB up and running using Docker.

Let's bring up the VM again (we stopped it previously with the vagrant halt command) and also MongoDB:

$> vagrant up
$> vagrant ssh
vagrant@vagrant-ubuntu-trusty-64:~$ docker start mongoDB
mongoDB
vagrant@vagrant-ubuntu-trusty-64:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED 360f5340d5fc mongo:2 "/entrypoint.sh mong..." 4 minutes ago STATUS PORTS NAMES Up 4 minutes 0.0.0.0:27017->27017/tcp mongoDB vagrant@vagrant-ubuntu-trusty-64:~$ exit

With docker start, we started the container; with docker ps, we listed all the running processes.

By using this kind of procedure, we are able to reproduce a full-stack environment in the blink of an eye. You may be wondering if this is as awesome as it sounds. The answer is yes, it is. Vagrant and Docker allow developers to focus on what they are supposed to do and forget about complex installations and tricky configurations. Furthermore, we made an extra effort to provide you with all the necessary steps and resources to reproduce and test all the code examples and demonstrations in this book.

主站蜘蛛池模板: 射阳县| 通海县| 襄垣县| 博罗县| 和龙市| 卫辉市| 乌兰浩特市| 灌阳县| 龙井市| 雅江县| 逊克县| 洛川县| 云和县| 布拖县| 龙胜| 米脂县| 西林县| 临猗县| 剑河县| 车险| 绥化市| 黑龙江省| 贺州市| 云阳县| 高邑县| 塔河县| 宁化县| 南漳县| 威远县| 右玉县| 苍溪县| 兰西县| 西城区| 沙湾县| 丁青县| 土默特左旗| 澄迈县| 玉山县| 宜黄县| 江阴市| 延川县|