What is Docker?
Docker is a tool, a container management system, officially released in 2013. The system is extremely useful when scaling, upgrading, and migrating to another server.
Docker uses the Go programming language. Although initially the tool could only be used on Linux hardware, it is now compatible with Windows and macOS devices as well.
The project is no longer niche. In a relatively short period of time, it has become popular among a wide range of professionals. It is already used for many solutions, and Docker gaining even more popularity is expected in the future. One of the main reasons for this is Docker Hub, a repository of prebuilt, freely accessible container images. Not only freelancers place their projects in the repository, but also enthusiasts who are passionate about programming. Official developers also leave dozens of prebuilt applications in the public domain. For example, you can now find Jenkins, Redmine, GitLab, MySQL, Apache, Elasticsearch, and many other solutions in the repository.
How to work with Docker
The system is simple and easy to use. As an example, let's try starting WordPress from scratch. With Docker, all you have to do to get started with this site management system is run commands:
docker run --name wp-mysql -e MYSQL_ROOT_PASSWORD=wpmsqlpsswd -d mysql:5.7
docker run --name my-wordpress --link wp-mysql:mysql -d -p 80:80 wordpress
After that, open a web browser page http://localhost, where instead of localhost you specify your server's external IP address, and proceed to configure WordPress.
When working with the ecosystem, users face these three fundamental terms:
- Image. This term refers to the layout used to create new containers. It is, in fact, a cast of the file system with program code and environment inside.
- Registry. The registry in the ecosystem is the Docker Hub we mentioned before.
- Container. A ready-to-use running application.
Benefits of using Docker
Convenience is what Docker users love. Installing additional software or creating a ready-made application using Docker is incomparably faster than setting it up manually. It allows to optimize the team’s work and drastically reduce the time spent on such procedures.
For example, you need to install Github, Jenkins, Redmine, etc. Instead of setting up the environment, packages, and web server yourself, you can run a container where most of the work is already done.
The hub.docker.com repository contains hundreds of thousands of such programs. They all install with the required libraries, so there will be no conflicts with other software.
You can also use Docker to port your application to another environment. To do this, upload your container to the repository and upload it to the new server.