03月05, 2019

Laravel 项目创建(基于 Composer 的 Docker 镜像)

ComposerDocker官方镜像基本用法: docker run --rm --interactive --tty --volume $PWD:/app composer install,使用Composer 创建Laravel用法是:composer create-project --prefer-dist laravel/laravel myproj "5.7.*"

$ sudo docker pull composer
$ cd ~/Workspace
$ sudo docker images
REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE
composer                     latest              163c599ae9c5        6 days ago          159MB
$ sudo docker run --rm --interactive --tty --volume $PWD:/app composer create-project --prefer-dist laravel/laravel myproj "5.7.*"
Installing laravel/laravel (v5.7.28)
  - Installing laravel/laravel (v5.7.28): Downloading (100%)         
Created project in myproj
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 86 installs, 0 updates, 0 removals
  - Installing symfony/polyfill-ctype (v1.10.0): Downloading (100%)
    ......
Application key set successfully.
$ ls myproj
app  artisan  bootstrap  composer.json  composer.lock  config  database  package.json  phpunit.xml  public  readme.md  resources  routes  server.php  storage  tests  vendor  webpack.mix.js

本文链接:https://xlange.com/post/use-composers-docker-image-to-create-laravel-project

-- EOF --

Comments

?