Warning: Use of undefined constant ‘classic_options’ - assumed '‘classic_options’' (this will throw an Error in a future version of PHP) in /www/wwwroot/blog.itisxx.com/wordpress/wp-content/themes/fullstack/single.php on line 4

Warning: Use of undefined constant ‘notice’ - assumed '‘notice’' (this will throw an Error in a future version of PHP) in /www/wwwroot/blog.itisxx.com/wordpress/wp-content/themes/fullstack/single.php on line 5
首页 > 生活 > CentOS7下docker方式安装magento2

CentOS7下docker方式安装magento2

生活 2019-8-21 10:47:01 52℃ 评论已关闭

1.VMware下centos7的安装

安装VMware Tools:

yum update

yum groupinstall "Perl Support"

mount -t auto /dev/cdrom /mnt/cdrom

cd /mnt/cdrom

cp VMwareTools-10.0.10-4301679.tar.gz ~/

tar -zxvf VMwareTools-10.0.10-4301679.tar.gz

cd vmware-tools-distrib

./vmware-install.pl

如果出现bash:./vmware-install.pl :/usr/bin/perl:bad interpreter:No such file or directory.现象,输入yum groupinstall "Perl Support"即可。

https://www.cnblogs.com/chen1970/p/11076424.html

2.安装docker

yum remove docker  docker-common docker-selinux docker-engine
yum install -y yum-utils device-mapper-persistent-data lvm2 
yum list docker-ce --showduplicates | sort -r
yum install docker-ce 或者
yum install containerd.io-1.2.6-3.3.el7.x86_64.rpm docker-ce-19.03.1-3.el7.x86_64.rpm  docker-ce-cli-19.03.1-3.el7.x86_64.rpm docker-ce
systemctl start docker 
systemctl enable docker 
docker version 

https://www.cnblogs.com/yufeng218/p/8370670.html

https://www.cnblogs.com/qgc1995/p/9553572.html

3.安装magento2

git clone https://github.com/alexcheng1982/docker-magento2/archive/master.zip

修改 docker-compose.yml 文件:如下:

version: '3.0'
services:
web:
image: alexcheng/magento2
ports:
- "80:80"
volumes:
- /www/html:/var/www/html
links:
- db
env_file:
- env
db:
image: mysql:5.6.23
ports:
- "3306:3306"
volumes:
- /www/data:/var/lib/mysql/data
env_file:
- env
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- "8080:80"
links:
- db
volumes:
data:

修改配置文件 env,可以改账号密码等

git clone https://github.com/alexcheng1982/docker-magento2.git && cd docker-magento2 && docker-compose up -d && docker exec -it docker-magento2_web_1 install-magento && docker exec -it docker-magento2_web_1 install-sampledata
http://local.magento
注意添加主机 Hosts 127.0.0.1 local.magento 

https://github.com/alexcheng1982/docker-magento2

https://www.cnblogs.com/q1104460935/p/9627878.html

docker常用命令:

docker images
docker rmi 07f
docker run -d -it -v /home/breeze:/var/www/html/code -p 18306:18306 07f bash

docker exec -it 1fb /bin/bash

docker container stop 1b3
docker container rm 1b3

docker run -d -it -v /mnt/hgfs/soft/breeze:/var/www/html -p 80:80 eea bash

上一篇: 下一篇:
请安装多说插件-下载地址