docker容器composer 部署 laravel框架
作者:互联网
首先yum install docker 安装docker
service docker start 启动docker
docker pull
docker.io/skiychan/nginx-php 下载这个镜像
docker images 查看镜像
然后创建容器
docker run --name "wzj" -p 8086:80 -p 9100:9100 -p 9101:9101 -p
9102:9102 -p 9103:9103 -it --privileged 42f3e309fe1a
/bin/bash
docker run --name "自己的名字"-p 8086:80 -p 9100:9100 -p 9101:9101 -p 9102:9102 -p 9103:9103 -it --privileged 镜像ID /bin/bash
docker ps -a查看容器
docker start wzj
docker exec -it wzj /bin/bash
yum install wget 安装wget
wget https://dl.laravel-china.org/composer.phar -O /usr/local/bin/composer 安装composer
赋予权限
chmod a+x /usr/local/bin/composer
export PATH=$PATH:/usr/local/php/bin 设置php环境变量
然后把composer的镜像换成国内的
composer config -g repo.packagist composer https://packagist.phpcomposer.com
cd data/www/
composer create-project --prefer-dist laravel/laravel blog
这样就完成了!
如果有错,像我这样
find / -name laravel
/root/.composer/vendor/bin/laravel new blog
标签:laravel,bin,9102,9103,composer,docker 来源: https://www.cnblogs.com/wzjia/p/10755486.html