Super simple implementation of Docker to build a personal blog system

Super simple implementation of Docker to build a personal blog system

Install Docker

Update the yum package to the latest version: sudo yum update
Install the required packages: sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Set the yum source to Alibaba Cloud, otherwise it will be very slow: sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum install docker-ce
Check the docker version after installation: docker -v
Set up a domestic mirror, ustc is a veteran Linux mirror service provider: vi /etc/docker/daemon.json
Enter the following content in the file:

{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}

Start Docker: systemctl start docker
Check the docker status: systemctl status docker
Start at boot: systemctl enable docker

Install the image

The data of the blog system is recorded in the database, which means it depends on the database, so you need to install the database first: docker run --name db --env MYSQL_ROOT_PASSWORD=example -d mariadb
db is the name of the docker container, -d means starting it in daemon mode (running in the background), mariadb is a database of mysql, docker will first search for the mariadb image locally, if it is not found, it will automatically download it from the warehouse

View the docker container status: docker ps -a

Install the wordpress blog system: docker run --name MyWordPress --link db:mysql -p 8080:80 -d wordpress
Use --link db:mysql parameter to establish a connection between WordPress and the database. Use -p 8080:80 parameter to map port 80 of the original service to port 8080 of the host machine.

insert image description here

View the docker container status: docker ps -a

insert image description here

Visit site

Visit the browser: http://192.168.2.9:8080
The host machine's IP is 192.168.2.9 , and the response is as follows:

insert image description here

After some simple settings, our blog system is set up

insert image description here

This is the end of this article about how to use Docker to build a personal blog system. For more information about building a blog system with Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Example of using Docker to build an ELK log system
  • How to build an elk system using docker compose
  • How to build a docker local image warehouse under centos7 system
  • Using Docker to build a lamp environment on Mac

<<:  HTML table tag tutorial (23): row border color attribute BORDERCOLORDARK

>>:  How to use VUE to call Ali Iconfont library online

Recommend

5 issues you should pay attention to when making a web page

1. Color matching problem <br />A web page s...

mysql8.0.11 winx64 manual installation and configuration tutorial

First of all, let me talk to you about my daily l...

Detailed explanation of MySQL transaction isolation level and MVCC

Table of contents Transaction Isolation Level Pro...

How to install Linux flash

How to install flash in Linux 1. Visit the flash ...

Analysis and practice of React server-side rendering principle

Most people have heard of the concept of server-s...

How to install redis5.0.3 in docker

1. Pull the official 5.0.3 image [root@localhost ...

v-html rendering component problem

Since I have parsed HTML before, I want to use Vu...

How to use VUE and Canvas to implement a Thunder Fighter typing game

Today we are going to implement a Thunder Fighter...

Detailed explanation of Docker usage under CentOS8

1. Installation of Docker under CentOS8 curl http...

Solution to ElementUI's this.$notify.close() call not working

Table of contents Requirement Description Problem...

Randomly generate an eight-digit discount code and save it to the MySQL database

Currently, many businesses are conducting promoti...

How to detect Ubuntu version using command line

Method 1: Use the lsb_release utility The lsb_rel...

Use of Linux file command

1. Command Introduction The file command is used ...

How to install MySql in CentOS 8 and allow remote connections

Download and install. First check whether there i...