System Requirements Verification
Verify Linux system parameters before Docker installation:
cat /etc/redhat-release
uname -r
Environment Preparation
Install essential packages if not present:
yum -y install gcc gcc-c++
Docker Removal (For Fresh Install)
Stop and remove existing Docker installations:
systemctl stop docker
yum remove docker docker-client docker-client-latest docker-common \
docker-latest docker-latest-logrotate docker-logrotate \
docker-engine docker-ce docker-ce-cli containerd.io
rm -rf /var/lib/docker
rm -rf /var/lib/containerd
Docker Enstallation Process
- Install prerequisite tools:
yum install -y yum-utils
- Configure repository (using Aliyun mirror):
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
- Update package index:
yum makecache fast
- Install Docker components:
yum -y install docker-ce docker-ce-cli containerd.io
- Start and enable Docker service:
systemctl start docker
systemctl enable docker
- Verify installation:
docker version
Container Management Basics
Run test container:
docker run hello-world
Basic container operations:
docker ps
docker exec -it [container_id] /bin/bash
docker start/stop/restart [container_id]
docker rm [container_id]
docker rmi [image_id]
Common Issues and Solutinos
-
Docker service fails to start
- Solution: Reinstall Docker components
-
MySQL connection issues
- Create new user with proper privileges:
CREATE USER 'newuser'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'%';
FLUSH PRIVILEGES;
- For MySQL 8 authentication issues:
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
- Network connectivity problems
- Check VM resource allocation (memory, CPU)
- Verify network configurations
- Ensure proper firewall settings
Performance Considerations
- Allocate sufficient resources to VM (recommended minimum 8GB RAM)
- Use SSD storage for better performence
- Monitor system logs during installation for potential issues