先删除旧版本
sudo apt-get remove docker \
docker-engine \
docker.io

要先升级内核

sudo apt update
sudo apt upgrade
apt-get install ca-certificates curl gnupg lsb-release

官网介绍 get.docker.com (OK)

# To install the latest stable versions of Docker CLI, Docker Engine, and their
# dependencies:
#
# 1. download the script
#
#   $ curl -fsSL https://get.docker.com -o install-docker.sh
#
# 2. verify the script's content
#
#   $ cat install-docker.sh
#
# 3. run the script with --dry-run to verify the steps it executes
#
#   $ sh install-docker.sh --dry-run
#
# 4. run the script either as root, or using sudo to perform the installation.
#
#   $ sudo sh install-docker.sh
#
# Command-line options

升级内核和依赖

apt update
apt upgrade

安装docker-compose Docker Compose version v2.22.0
(可能是这个原因,OCI除了实例ubuntu3,其他经常崩溃,改用sh运行)

$ sudo curl -L “https://github.com/docker/compose/releases/download/v2.22.0/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose

将可执行权限应用于二进制文件:
$ sudo chmod +x /usr/local/bin/docker-compose

创建软链:
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

测试是否安装成功:
$ docker-compose
version cker-compose version 1.24.1, build 4667896b

重启服务器

进入到 /root/wp下执行

cd /root/wp

Apt install docker-compose

Docker-compose –f dc-2.yml up

安装完成后在地址栏输入

http://192.168.0.22:80

便可安装wordpress

直接访问 IP:80 就可以开始安装wordpress

By liu

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注