Docker is a set of platform-as-a-service products that use operating-system-level virtualization to deliver software in packages called containers. Docker, inc. was founded by Solomon Hykes and Sebastien Pahl during the Y Combinator Summer 2010 startup incubator group and launched in 2011
By using the docker you can modernize your applications, accelerate innovation and Securely build, share and run modern applications anywhere.
Download the docker software from Docker official site for the operating system you are using and install it.
Create an empty project directory.
You can name the directory something easy for you to remember. This directory is the context for your application image. The directory should only contain resources to build that image.
This project directory contains a
docker-compose.yml file which is complete in itself for a good starter wordpress project.
Tip: You can use either a
.yaml extension for this file. They both work.
Change into your project directory.
For example, if you named your directory
docker-compose.yml file that starts your
WordPress blog and a separate
MySQL instance with a volume mount for data persistence:
docker-compose up -d from your project directory.
docker-compose up in detached mode, pulls the needed Docker images, and starts the WordPress and database containers.
Once the docker process finish, then open
http://MACHINE_VM_IP:8000 in a web browser.
If you are using Docker Desktop for Mac or Docker Desktop for Windows, you can use
http://localhost as the IP address, and open
http://localhost:8000 in a web browser.
docker-compose down removes the containers and default network, but preserves your WordPress database.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.