How Docker is useful to ordinary developers (go)

Source: Internet
Author: User

Some developers may still not understand how much Docker is good for themselves, so translating the Docker personal use case in this article describes the use cases of Docker in the development of common developers.

Docker is now gaining a lot of attention, and many people feel Genji greatly hyped because they still don't know what it's like to have a Docker and a regular developer. Many developers feel Docker is far away from themselves, and Docker is a tool in the production environment that has nothing to do with it. It took me a long time to figure out how to use Docker as an ordinary developer in my own development. Frankly speaking, I am still in the process of learning.

This article provides a list of Docker use cases, and I hope it will better help you understand Docker and trigger your thinking. This article simply describes the daily application of Docker in ordinary developers and does not provide a complete solution.

Before I introduce the use case, I want you to remember this phrase: "Docker is a portable application container ." You may not know what Docker means by "portable containers", but you have to be aware that Docker can bring about a lot of productivity gains in the daily life.

When you need to run your own application within a container (which can be any application, of course), Docker provides a basic system image as the underlying system for running the application. In other words, any application on a Linux system can run in Docker.

Can I run the database in Docker?

Can I run the node. JS Web server inside Docker?

Can I run an API server inside Docker?

Docker doesn't care what your application is and what it does, Docker provides a set of ways to package, transport, and deploy apps so you can better run any application within the container.

Here are some examples of my own use, of course, you have a better case can also share to me.

Try new software

For developers, there are a variety of new technologies that need to be tried every day, but developers are less likely to build environments and test them. Time is invaluable, thanks to Docker, which allows us to build the environment within one or more commands. Docker has a stupid way to get the software, and the Docker backend automatically gets the environment image and the environment is running.

It is not just a new technology environment that is built to get Docker. If you want to quickly run a MySQL database on your laptop, or a Redis message queue, then using Docker can be very easy to do. For example, Docker requires only one command to run the MySQL database: Docker run-d-P 3306:3306 tutum/mysql.

Note: Although the MySQL database can be installed very quickly using commands, using Docker is a great option when using the latest technology or very complex technology, such as Gitlab, where it takes about a day for the average user to build the Gitlab platform, and Docker requires only one command.

To demonstrate

Now I often need to do one or two demos on the weekends with the results I've developed for my clients to live with. The process of building a demo environment is cumbersome. Now I find that Docker has become the most logical way for me to demonstrate these tools. At the same time, for customers, I can directly provide the Docker image to them, without having to do any environment configuration work, the work will be the same as they see in their presentation, without worrying about their environment configuration will cause our product not to run.

Avoid "I can run on my machine"

This is mentioned in either the enterprise deployment Docker described in the previous article or the personal Docker use case for this article. Because of the different environment configuration, many people in the development will also encounter this situation, even the development of software to the testers of the machine can not run. But that's not the point. The point is that if we have a reliable, distributable standard development environment, our development will not be as painful as it is now. Docker can solve this problem. Docker images do not work because of changes in the environment, and do not have different results on different computers. You can submit a Docker image with an app to the tester so that the "run on my Machine" thing is no longer happening, which greatly reduces the time cost for developers to check each other's machine environment settings.

Another area where Docker can use is the training course. In addition to the isolation of Docker containers, there is a better understanding of the advantages of Docker in environmental construction. Everyone in the training class spends a lot of time on setting up the environment, but if you apply it to Docker, we just need to distribute the standard operating environment image and then we can start the class. Using Docker is as easy as using a virtual machine, but Docker is more convenient and lightweight. At the same time, we can also tell the students: "In the training, we will also learn the most popular technology--docker", this winning outcome, why not.

Learn Linux Scripts

This may seem strange, of course, but it's a good opportunity for people who are not familiar with the Linux operating system and Shell scripts. Even if this article is not talking about the importance of linux,linux is still self-evident. If you're using Windows, I'll give you a piece of advice: Rent a cloud host from a cloud hosting provider: I recommend using a cloud host for the CoreOS system. While this does not make you a professional Linux operation, it allows you to quickly learn the basics of Linux, fall in love with command-line operations, and slowly begin to familiarize yourself with and appreciate Linux.

Better use of resources

The granularity of virtual machines is "virtual machines", while Docker granularity is "restricted application", compared to Docker's less memory footprint and more lightweight.

For me, this is one of the advantages of Docker: Because I often run multiple Docker apps on my computer, using Docker is simpler, more convenient, more granular, and keeps track of the status of the container than using a virtual machine.

customizing for MicroServices

If you've been focusing on tech news, you've heard about the concept of microservices (microservices). Docker can be a good combination of microservices. Conceptually, a microservices is a subset of the functionality that provides a complete set of applications, and Docker can serve as a container for microservices during development, testing, and deployment. Even the production environment can deploy microservices in Docker.

Porting between cloud service providers

Most cloud hosting providers already have full support for Docker. For developers, this means that you can easily switch between cloud service providers and, of course, easily move your local development environment to a cloud host without having to configure a running environment on-premises, and also configure a running environment on the cloud host. Full deployment of Docker (Docker here and Docker there) as a standard operating environment can greatly reduce the amount of work and bugs that apply when the app is online.

API side

APIs are adhesives between applications, and a qualified developer must have used rest APIs provided by others, or developed rest APIs on their own. It should be noted that both the client and the API provider need to define a common set of API interfaces prior to development before they can be encoded. If the server and the client are jointly developed, then the server will usually implement a fixed string of API interface, in the future development and then slowly to implement the function of the API.

While some would think that Docker is being abused here, it is possible to implement virtual APIs with Sample.json files, but there is an example to better address the API issues of front-end separation development.

To better explain what I mean, give us an example: JSON Server, a REST API for providing JSON data. People who have used this container will know that since there is such a good Docker JSON Server, there is no reason not to use Docker.

Translator Note:

    • Run the sample JSON Server, and use the JSON file provided in the example to create a server-side API app with just one command.
    • Use Curl Http://127.0.0.1:80/posts to get the posts segment in the sample file so that the front end can be co-developed as soon as the backend is not finished developing the API.

Innovation in Technology

This should not be a use case, but I'm going to write about it. Docker is growing fast, tools are constantly being updated, and no one can foresee what Docker will look like in the future. The more you use Docker in a complex system, the more likely you will find technical gaps and the direction of future technology development. It's still in the development of Docker, and any tool you create with Docker is likely to be a hot spot for community attention. This is a chance for Docker and a chance to make yourself a success.

Your use-case

The last one is no longer my use case, but how much Docker can play in your hands. I would also like to see you provide more ways to use Docker, please leave a message.

Other

There are two tips to share with you. in the process of learning Docker because of these two help, I am proud to constantly improve themselves.

One: Docker Hub Registry. This is the official Docker image warehouse, in addition to hosting the official Docker image, like Github, you can upload your own image, you can also search for other useful images on the above, greatly saving their time. For example oracle-xe-11g mirroring, everything is ready-made and does not need to download the Oracle XE 11g installation at all. This saves you and the team a lot of time costs.

If you're not sure, you can go to the Docker Hub and search for any images you've got. In most cases, the image you need is already being built on the Docker Hub.

Second: Multi-reference IaaS provider news, although we can not be as in their meeting room to fully understand their company dynamics, but still can be from the news to learn about Docker's latest development direction and technology trends. To be sure, containerized technology is a hot spot for the future, and we can not only run Docker on this machine, not just run Docker on a host of a cloud service provider, but all cloud service providers will support Docker in the future.

Docker's prospects are clear, and using Docker will only make development easier.

Original link: dockone.io/article/378

Transferred from: http://cloud.51cto.com/art/201505/476644_all.htm

How Docker is useful to ordinary developers (go)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.