Docker just celebrated its 6th anniversary earlier. Back in 2013, Oursky was probably one of the earliest adopters. We start using Docker long before it goes mainstream. And to be honest, when we start using Docker 6 years ago, we haven’t imagined that Docker would have evolved at an astonishing pace like this. Throughout our 6-year journey with Docker, we find great potential for how Docker could benefit the Company and get inspired by the use cases. In this blog post, we are going to share our own experience with you about:
- why we use Docker in the first place;
- what concerns we had before adoption;
- how we adopt Docker;
- use cases and real-life examples in our company;
- takeaways (for whom want to start using Docker)
Why Use Docker?
It’s interesting that our initial motivation for using Docker is trying out the latest technology (our company culture!). Python has been really popular in Oursky, and Docker just naturally caught our attention when it was first released at PyCon 2013.
Besides, we are a software company focusing on mobile app / web development, so we do a lot of server side development and deployment day-to-day.
Before using Docker, we need to set up separate development environments for different languages. For example, we need to setup pyenv for Python, or rvm for Ruby.
At the same time, we encourage our developers to pick the right programming language for each project (company culture again!). It’s not hard to imagine that, when our team is growing bigger, it becomes more and more difficult to maintain language-specific containment – especially for companies like us who love to embrace different kinds of technologies.
Docker came under the spotlight since it is language agnostic at containment level, which means we can unify the environment and save a lot of setup time before kickstarting development. And for software development, saving time is not just about improving your own efficiency, it helps your clients save costs too.
After using Docker, it brings more benefits to the company than we expected (we’ll go through the use cases and benefits in details at the later part of this article), and we soon become a fan of Docker and start expanding the scope of usage. Now 6 years gone, and we are using it more than ever!
What Concerns We Had Before Using Docker
6 years ago, Docker was still new to the market. Apparently it did not promise a plain sailing for adoption, and it was hard to find someone sharing experience online. Recalling what we hesitated about Docker:
- Mac support was not good, it was annoying since we use MacOS for development.
- There was no docker-compose at that time, which means there is no standard way to compose a Docker container. We have to spend extra time on configuring settings manually.
- Docker was not stable when handling stateful instances. So we have only been using Dockers for stateless services for quite a long time.
- We have no idea if it is a sustainable tech. Will it be sunset soon?
But we all know that it takes time to discover the good and bad of a new technology. Not a single technology can be perfect at its first launch.
Though we had a few concerns, we still decided to be a pioneer of using Docker, considering the great potentials that Docker could benefit our engineering team (or to be honest we have once thought rkt may become more popular and replace Docker…).
Where To Start? Here’s How We Adopt Docker Step-by-Step
We adopt Docker gradually from trial to full implementation. If you want to introduce new technology to your company, the first thing to do is to get your people to try. Here are the steps we took:
- At first, we created a virtual machine that everyone can freely deploy docker app for fun.
- We then added a Docker building machine into our CD pipeline, so that everyone can use Docker at the stage of CD. At that time, Travis-CI hasn’t supported Docker yet and so we reserved a single EC2 machine instead.
- We then accepted Github commit trigger
reposaccording to the Dockerfile in that repo.
- After taking these steps, one of our developers became a super fan of Docker. He started to send PR to different internal
repos andprovided demos on how to use Docker.
- Thanks to him, a company-wide momentum was gradually gathered. We are glad to see that more and more developers tried Docker in different projects.
In the following year, Docker kept evolving remarkably and finally became a roar. Container technology became a buzzword which you couldn’t ignore. Big players jumped into this market one by one.
Eventually, our whole pipeline is docker-ready when all tech giants (like AWS, Azure and GCP) are supporting Docker. We widely adopt Docker within our company, not just for deployment but also at development stage. Even our QA team use Docker and built an image with over 1 million pulls.
Real-life Docker Use Cases Examples: How Do Companies Use Docker?
So how do companies use Docker? Let’s take a look at some of the Docker use cases and benefits found in our company:
1. Environment standardization
Since Docker documented instructions for how to create an environment with a Dockerfile, you can minimize the inconsistency between different environments. It is a big advantage that it makes your development environment repeatable. You can also ensure that every team member is working in the same environment.
In Oursky, we use docker-compose for development, testing and production. The Dockerfile and docker-compose configuration file are committed to
2. Faster configuration with consistency
With Docker, configurations become simple. You can just put your configurations into code and deploy it.Things done. You can also use your configurations repeatedly since Docker supports a wide variety of environments.
As we expected, one of the biggest benefits for using Docker in our company is accelerating project setup, especially for new developers. Development environment is the same for every developer. Once we have consistency, even new team members can skip the time-consuming environment settings and start development with any kind of programming language right away. By saving configuration time, we can spend more time on important things like development or QA testing.
Another benefit is that, once we have standardized the Docker configuration, we save a lot of time from preparing the setup and deployment documentation about the procedures and processes. Even with less documentation, we are still certain that the
3. Better disaster recovery
Disaster is unpredictable. However, you can backup a Docker image (also called “snapshot”) for the state of the container at that backup moment, and retrieve it later when serious issues happen. For example, a hardware failure just happened and you need to switch your work to a new hardware. With Docker, you can easily replicate the file to the new hardware and recover from disaster.
Our own example is, sometimes we found a bug when deploying a new version of one particular software. We can revert to the last version with the previous Docker image easily and soon recover from failure. Besides, without Docker, we have to set up the rollback step from runtime to runtime. You can imagine rolling back a PHP site and a Go binary are two different workflows. But with Docker, we just need one workflow only.
We envisioned that the DevOps community will gradually use Docker as the first step towards standardizing contained deployment a few years ago.
When people talk about the relationship between Docker and DevOps, the first thing that comes to mind would be CI/CD. With Docker, the testing environment is consistent with your production environment. If those changes can pass CI/CD, they should work in production too. In Oursky’s workflow, we use the same container for testing and production. Docker has a positive impact here to make the process from testing to production go smooth.
Furthermore, standardization plays a key role for automation. Docker simplifies DevOps by standardizing the configuration interface and makes machine setup simpler. In addition, as Docker has a standard setup interface, you can ensure that the interface is standardized for all members, while no one will get frustrated with ever-changing user interfaces. Overall, we think Docker is a favourable tool for improving DevOps in the company.
4 Key Takeaways (For Whom Want To Start Using Docker)
You may have read a lot about Docker use cases, and finally made a decision to go for it. If you want to start using Docker in your tech team, we have a few tips for you:
1. Don’t expect company-wide adoption overnight
Our first suggestion is, don’t push overnight. Run in parallel on Docker/non-Docker development first.
You can encourage using Docker for deployment on small projects, and extend to bigger ones when the pipeline is ready and mature. Provide sufficient time for developers to get used to new technology, as well as having buffer time to test if Docker fits into your company or operations.
Docker is not a silver bullet, always test it on a small scale first.
2. Not only for deployment, use Docker in workflow
Though Docker benefits deployment, don’t limit its usage on deployment only. You can use Docker in the workflow (e.g. development). In Oursky, we use Docker in environment setup and save time for new developers setting up projects.
Extend the usage at different stages and let developers have more chance to try new technology. For example, Docker supports continuous integration & continuous deployment (CI/CD) and allows collaboration between team members through sharing of Docker images and simplifies deployment.
There are plenty of CI/CD tools in the market providing solutions to leverage Docker container technology and help to improve your workflow too.
3. Provide incentives to use Docker
Sometimes, developers may be skeptical about new technology.
Provide more incentives to the developers. You can consider defaulting the CD pipeline with Docker setup. On the other hand, you can organize demos or sharing sessions to share practical use cases.
Encourage them to use it for development, deployment and production. Only when the developers truly think that it is helpful to their work, they will promote Docker usage organically without a push.
4. Prepare a set of Docker setup instructions for QA
We’ve known that Docker can simplify configurations and make environment setup faster, but it’s still better to have a set of docker setup instructions for QA purpose.
Take our company as an example. We have
What’s Next From Here…
6 years ago, what Docker claims (you can run containers anywhere regardless of environments or infrastructure) sounds too good to be true.
However, Docker has proved its benefits and how it could help in every stage of software development or DevOps throughout the years. We are glad that we made the right decision of using Docker early, so that we can accumulate more use cases to refine our operations.
The whole container ecosystem is now growing bigger than ever. Apart from Docker, Kubernetes also contributes to the growth of the container ecosystem. In case you don’t know, Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. It enables management of containers at scale. Along with the popularity of Kubernetes, all major cloud providers have incorporated Kubernetes as the orchestration layer when providing container services.
If you want to further understand Docker, Kubernetes and the container ecosystem, here are a few useful links for your reference:
- A High-Level History of the Container Ecosystem, 2013-2019
- What is a Container?
- Docker and Kubernetes
- Beyond Docker and Kubernetes: The container ecosystem continues to evolve
Interested in knowing more about Docker use cases or sharing your thoughts? Please leave your comments below and we look forward to hearing from you.
If you are looking for consultancy on applying Docker or DevOps, or seeking a technology partner to develop microservices applications for you, talk to our consultant and we’d love to help by sharing our expertise with you!