geshan / docker-laravel-alpine

Docker container for running tests for Laravel 5.x
9 stars 6 forks source link

new project #6

Closed infacq closed 7 years ago

infacq commented 7 years ago

I notice this is just for existing laravel project. How about a new one?

docker run -v $(pwd):/var/www geshan/laravel-alpine "composer create-project --prefer-dist laravel/laravel blog"

but I hit error

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/xml.so' - Error relocating /usr/lib/php/modules/xml.so: _safe_emalloc_string: symbol not found in Unknown on line 0

Installing laravel/laravel (v5.4.9)
  - Installing laravel/laravel (v5.4.9)
    Downloading: 100%         

Created project in blog
> php -r "file_exists('.env') || copy('.env.example', '.env');"
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/xml.so' - Error relocating /usr/lib/php/modules/xml.so: _safe_emalloc_string: symbol not found in Unknown on line 0
Loading composer repositories with package information
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - phpunit/phpunit 5.7.9 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.8 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.7 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.6 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.5 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.4 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.3 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.2 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.14 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.13 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.12 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.11 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.10 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.1 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - phpunit/phpunit 5.7.0 requires ext-xml * -> the requested PHP extension xml is missing from your system.
    - Installation request for phpunit/phpunit ~5.7 -> satisfiable by phpunit/phpunit[5.7.0, 5.7.1, 5.7.10, 5.7.11, 5.7.12, 5.7.13, 5.7.14, 5.7.2, 5.7.3, 5.7.4, 5.7.5, 5.7.6, 5.7.7, 5.7.8, 5.7.9].

  To enable extensions, verify that they are enabled in those .ini files:
    - /etc/php/php.ini
    - /etc/php/conf.d/ctype.ini
    - /etc/php/conf.d/curl.ini
    - /etc/php/conf.d/dom.ini
    - /etc/php/conf.d/json.ini
    - /etc/php/conf.d/mcrypt.ini
    - /etc/php/conf.d/mysql.ini
    - /etc/php/conf.d/openssl.ini
    - /etc/php/conf.d/pdo.ini
    - /etc/php/conf.d/pdo_mysql.ini
    - /etc/php/conf.d/phar.ini
    - /etc/php/conf.d/xml.ini
    - /etc/php/conf.d/zzz-custom.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

how do I go from here? I'm quite new to Docker, sorry if this too noob for you

geshan commented 7 years ago

can you please give it a try with the php-7 branch: https://github.com/geshan/docker-laravel-alpine/tree/php7-branch ?

Run the following command:

docker run -v $(pwd):/var/www geshan/laravel-alpine:php7 "composer create-project --prefer-dist laravel/laravel blog"

If you want to start a new project then its best to use the latest major version of PHP, PHP 7 :). Above command worked fine for me @infacq

infacq commented 7 years ago

yes it worked. Why not make it default to latest?

infacq commented 7 years ago

how do I run the server

geshan commented 7 years ago

It's not meant to serve pages "This image is made for running tests for laravel not serving it over a web servicer like Nginx. It is primarily being used to run unit tests on Wercker. ". For a nginx and MySQL setup try this: https://geshan.com.np/blog/2015/10/getting-started-with-laravel-mariadb-mysql-docker/ it's a year and half old so hopefully still works :). Thanks.

infacq commented 7 years ago

oh I see.. :p