Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand Docker

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces you how to understand Docker, the content is very detailed, interested friends can refer to, hope to be helpful to you.

You may encounter a scenario where other services such as databases and messaging systems (messaging system) also have to rise when developing software. Usually these services may be installed on the developer's own machine or run in a virtual machine. Recent events around Docker have proved to be an interesting alternative. With Docker and a gadget called dock, you can start all the services needed by your development environment in a short period of time.

You don't know what Docker is? No problem. With dock, you don't really need to know Docker. You just need to install Docker. My colleague Lukas Pustina wrote a blog about Docker in more detail.

Introduction

Imagine that you want to develop a prototype quickly and need a MongoDB to run locally. Using dock, it is easy to start the service. Just type dock mongodb and it will be fine. Or enter dock redis to start Redis? Dock makes programmers happy to start a variety of isolated services easily and quickly. You can also perform more, more complex steps like the following list:

$dock redis jenkins sonar Starting redis (using / Users/ben/.dock-formulas/formulas/redis) Container started Name: redis IP: 192.168.59.103 Ports: 6379 Starting jenkins (using / Users/ben/.dock-formulas/formulas/jenkins) Container started Name: jenkins IP: 192.168.59.103 Ports: 8472 Starting sonar ( Using / Users/ben/.dock-formulas/formulas/sonar) Container started Name: sonar-mysql IP: 192.168.59.103 Ports: 3306 Container started Name: sonar-server IP: 192.168.59.103 Ports: 8474

Docker is used at the bottom of dock. Docker itself is powerful, and dock makes it more generic. Dock adds a rule mechanism (formula mechanism) to target the local development environment that developers need. Without this rule mechanism, you must know how to start the container, which image to use, and which ports to open. Dock is committed to making developers only need to know the name of the service. The rules are maintained on GitHub, and other developers can extend them through pull request. If the service you need is not included, please send pull request or issue.

Dock allows you to move between different rules. You can print the details of the rule by adding the-cat parameter when you run dock. This information includes which Docker commands were executed by dock. Use some information to learn Docker or as a boost to your ability.

Installation

Dock is hosted on GitHub and is a shell script. Installation is easy, just download the script and add it to your $PATH path. OS X users can install through Homebrew, of course, you have to install Docker first.

# as an OS X user with Homebrew brew tap bripkens/dock brew install dock # for other platforms (assuming ~ / bin is on your $PATH) curl https://raw.githubusercontent.com/bripkens/dock/master/dock-so ~ / bin/dock & &\ chmod + x ~ / bin/dock & &\ dock-u &\ echo "dock installation successful. Try running 'dock'" summary

Docker has great potential, and dock makes it easier to use. Dock is very helpful when you are prototyping or learning new technologies, and of course, you can use it as a daily infrastructure. Currently, there are few services supported by dock, but it is easy to extend. Tell me any clothes you need, or send pull request to help.

On how to understand Docker to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report