Laradock 的安装使用及配置

首先克隆项目:

git clone https://github.com/Laradock/laradock.git
cd laradock/
cp env-example .env

配置 UBUNTU_SOURCE 为阿里云的源,防止 apt-get update -yqq 问题:

vim .env

# Change the separator from : to ; on Windows
COMPOSE_PATH_SEPARATOR=;

# If you need to change the sources (i.e. to China), set CHANGE_SOURCE to true
CHANGE_SOURCE=true
# Set CHANGE_SOURCE and UBUNTU_SOURCE option if you want to change the Ubuntu system sources.list file.
UBUNTU_SOURCE=aliyun

# 修改nvm镜像下载源
WORKSPACE_NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node

# 修改工作区时区
WORKSPACE_TIMEZONE=UTC

修改PHP时区

vim laradock/php-fpm/php7.x.ini

date.timezone=Asia/Shanghai

转换unix换行符,防止 /bin/sh: 1: /tmp/sources.sh: not found 问题:

vim workspace/sources.sh

:set ff=unix
:wq

访问 https://www.ipaddress.com/ 查询 raw.githubusercontent.com 的IP地址,防止 SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443 问题:

vim C:\Windows\System32\drivers\etc\hosts

127.0.0.1         localhost
199.232.96.133    raw.githubusercontent.com

CMD 命令行执行:

ipconfig /flushdns

构建和启动容器:

docker-compose up --build -d nginx mysql phpmyadmin redis workspace 

编写测试程序:

mkdir public/
cd public/
vim index.php

测试访问:

curl http://localhost

参考:https://github.com/laradock/l...

你可能感兴趣的:(docker)