nobiki/laravel-docker.sh

(ホストに)必要な物

  • curl
  • docker-ce
  • docker-compose
  • php
  • composer

以下のバージョンで動作させていますが、少し違ってもなんとかなると思います

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$ php -v
PHP 7.2.10 (cli) (built: Oct 3 2018 16:11:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans

$ composer -V
Composer version 1.7.2 2018-08-16 16:57:12

$ docker version
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:23:18 2018
OS/Arch: linux/amd64
Experimental: false

Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:22:21 2018
OS/Arch: linux/amd64
Experimental: false

$ docker-compose version
docker-compose version 1.23.1, build b02f1306
docker-py version: 3.5.0
CPython version: 3.6.7
OpenSSL version: OpenSSL 1.1.0f 25 May 2017

コマンド

1
2
3
4
$ mkdir [Project名]
$ cd [Project名]

$ curl https://gist.githubusercontent.com/nobiki/c5a4ed29119c976bb469637b8f6e2c2f/raw/30bdfe54ad51230e5b01698c7fb713774a4c96c7/laravel-docker.sh | sh -

補足

  • PHPのバージョンを変えたい → docker-compose.ymlを書き換えて下さい
  • Laravelのバージョンを変えたい → laravel-docker.shを書き換えて下さい
  • コンテナ名を変えたい → docker-compose.ymlを書き換えて下さい