Changing the Way of Continuous Delivery with Docker (Part 2)

Introduction

Docker is a service that has reformed the way of conducting continuous delivery. Docker allows you to package an application with all of its dependencies into a standardized unit for software development and guarantees that the software will always run the same, regardless of its environment. The first part of this series gave an outline of the overview, challenges, and environment and build requirements for using Docker. This post will explore the specific methods for using Docker along with the delivery processes.

How to Use Docker

Step 1: Installing the Docker runtime environment

The Docker runtime environment has only one limitation, that is, the Linux operation kernel must be higher than version 3.10. Docker provides a convenient method to install and setup a Docker environment on your machine using Docker Toolbox. This installer allows you to easily install Docker regardless of the underlying OS. It also supports a variety of cloud servers, including Alibaba Cloud’s Elastic Computing Service (ECS) servers.

Step 2: Using Dockerfile to describe the application environment

  • Method 1:

Step 3: Using Docker to build compiling/unit testing environments

Step 4: Using Docker to describe dependencies on environment

An application cannot do with only images but also depends on a database, if not another application. For example, a database is necessary when performing data testing.

  1. Use .yml to describe the dependency
    In most circumstances, using a single container does not solve most problems. You can use .yml to describe one or more web applications, databases, and others.
  • Storage
    Mount on the host machine using -v, and then store the database and initialized data under a local directory. This allows you to click on the app rather than initializing it upon each time of running.

Dockerized Delivery Process

Conclusion

1. What does Docker delivery bring?
It makes development clearer and more flexible to developers. Previously, the concern was on Java dependency, and it was quite hard to build a Java environment locally. However, now that concern has shifted to the dependency of the whole environment, it makes Java environment build much easier. With this approach, O&M personnel no longer need to change their schedule due to software dependencies, and do not have to constantly change the configuration. What can Docker be applied to? Every project and environment for everyone. It is also the most effective implementation of DevOps. With Docker, you can apply programming to operations and manage environmental operations using development practices.

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.