laradock / laradock Goto Github PK
View Code? Open in Web Editor NEWFull PHP development environment for Docker.
Home Page: http://laradock.io
License: MIT License
Full PHP development environment for Docker.
Home Page: http://laradock.io
License: MIT License
My laravel site dir like this: ~/git/code/hfcms.dev
.
I cloned your git to the root of my site,the dir like this: ~/git/code/hfcms.dev/docker
Than,I run docker-compose up
,and it running up,when I use chrome and visit http://hfcms.dev ,chrome response Page not working and 500.
Here is my ~/git/code/hfcms.dev/docker/docker-compose.yml
file:
###########################################################
# MAINTAINER: Mahmoud Zalt <[email protected]> #
###########################################################
# PHP + NGINX Container #----------------------------------
php-nginx:
image: laradock/phpnginx:latest
container_name: php-nginx
ports:
- "80:80"
volumes:
- ./settings/nginx:/etc/nginx/sites-available
- ../:/var/www
- ./logs/nginx:/var/log/nginx
links:
- mysql
- redis
privileged: true
extra_hosts:
- "hfcms.dev:127.0.0.1"
# MySQL Container #----------------------------------------
mysql:
image: laradock/mysql:latest
container_name: mysql
ports:
- "3306:3306"
volumes_from:
- data
environment:
MYSQL_DATABASE: hfcms_dev
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
privileged: true
# Redis Container #----------------------------------------
redis:
image: laradock/redis:latest
container_name: redis
ports:
- "6379:6379"
volumes_from:
- data
volumes:
- ./logs/redis:/var/log/redis
restart: always
privileged: true
# Data Volume Container #----------------------------------
data:
image: laradock/data:latest
container_name: data
volumes:
- /var/lib/mysql
- /var/lib/redis
# Beanstalkd Container #-----------------------------------
# beanstalkd:
# image: laradock/beanstalkd:latest
# container_name: beanstalkd
# ports:
# - "11300:11300"
# privileged: true
#----------------------------------------------------------
And this is my ~/git/code/hfcms.dev/.env
file:
APP_ENV=local
APP_DEBUG=true
APP_KEY=qibNQE0AK3dAMQ0FkXcSS1TgajRni12e
APP_URL=http://hfcms.dev
DB_HOST=hfcms.dev
DB_PORT=3306
DB_DATABASE=hfcms_dev
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=hfcms.dev
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Script php artisan clear-compiled handling the post-install-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Uncaught Error: Class 'Memcached' not found in /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php:51Stack trace:
#0 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php(20): Illuminate\Cache\MemcachedConnector->getMemcached()
#1 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(164): Illuminate\Cache\MemcachedConnector->connect(Array)
#2 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(102): Illuminate\Cache\CacheManager->createMemcachedDriver(Array)
#3 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(77): Illuminate\Cache\CacheManager->resolve('memcached')
#4 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(55): Illuminate\Cache\CacheManager->get('memcached')
#5 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(66): Illuminate\Cache\CacheManager->store('memcached')
#6 /var/www/laravel/vendo in /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php on line 51PHP Fatal error: Uncaught Error: Class 'Memcached' not found in /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php:51
Stack trace:
#0 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php(20): Illuminate\Cache\MemcachedConnector->getMemcached()
#1 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(164): Illuminate\Cache\MemcachedConnector->connect(Array)
#2 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(102): Illuminate\Cache\CacheManager->createMemcachedDriver(Array)
#3 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(77): Illuminate\Cache\CacheManager->resolve('memcached')
#4 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(55): Illuminate\Cache\CacheManager->get('memcached')
#5 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(66): Illuminate\Cache\CacheManager->store('memcached')
#6 /var/www/laravel/vendo in /var/www/laravel/vendor/laravel/framework/src/Illuminate/Cache/MemcachedConnector.php on line 51
This error occurs when I connect to the workspace and run any kind of artisan command. Even if I not use memcached as the cache driver. :/
Solution was to require php7.0-memcached
in the workspace Dockerfile. In my opinion it isn't good to have two configurations of php for the same application. Is there any solution to use the php-cli from the php-fpm container? Or have an extra php-cli container to know that there are these two different containers and the structure of both is the same?
I am complete new to docker and i am trying to get it up & running within my laravel project.
Okay so i installed docker / docker-toolbox aud cloned the repo into my laravel application folder. e.g /Users/chris/Desktop/code/laravoice/docker
.
Okay now i try to get it up & running. I edited my .env
file to match the DB_HOST with my docker IP. In my case DB_HOST=192.168.99.100
.
After this i switched to the /docker
directory in my laravel app and run the command docker-compose up -d
. But then i am getting the error below.
Host already exists: "default"
☁ docker [master] docker-machine ip default
192.168.99.100
☁ docker [master] docker-compose up -d
ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.
☁ docker [master] docker-machine start default
Starting "default"...
Machine "default" is already running.
Could you tell me what i am doing wrong? The Docker machine seems to be running, so i dont know why the daemon cant connect
Hi,
At line https://github.com/LaraDock/laradock/blob/master/docker-compose.yml#L40 you set "restart: always" that makes redis to be restarted each time I restart my laptop.
You should remove this line to let it start only when we need the compose stack to be up.
Thanks :)
The php-nginx container, using docker-compose, returns "exit 0" since the last change (one day).
And you didn't tag older version, so I cannot run my project now... damned.
Could you please:
Thanks a lot :)
I followed the tutorial to installing Laradock on Ubuntu 15.10.
When I run the command docker-compose up -d
I get the following error on terminal:
Starting data
Starting redis
Starting mysql
Starting 3f9705a53bbd_php-nginx
ERROR: Cannot link to a non running container: /9249350508fd_redis AS /php-nginx/redis
I'm new to docker, so I can't figure out if this issue is a bug or if I made a mistake.
And Thanks for this repo!
docker-compose up
,there is a error alert blow:Starting data
redis is up-to-date
mysql is up-to-date
Starting php-nginx
ERROR: failed to create endpoint php-nginx on network bridge: Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
docker-compose.yml
is blow:php-nginx:
image: laradock/phpnginx:latest
container_name: php-nginx
ports:
- "80:80"
volumes:
- ./settings/nginx:/etc/nginx/sites-available
- ../:/var/www
- ./logs/nginx:/var/log/nginx
links:
- mysql
- redis
privileged: true
extra_hosts:
- "laravel.dev:127.0.0.1"
git/Code/hfcms/
,the docker dir is git/Code/hfcms/docker
.When I enter the mysql container docker exec -it docker_mysql_1 bash
,there is no problem.But if I enter the mysql
,there is ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
.
When I use mysql -u root -p
,there is ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
What is the initial password and how to reset it quickly?
Using redis as the cache and session drivers yields this error from Laravel. Are there other steps required to use redis that aren't in the notes?
Hi,
How can i use php 5.6 in LaraDock?
Am running in a weird issue, Am trying to run docker-compose up -d and i am facing this issue all the time
E: There are problems and -y was used without --force-yes
ERROR: Service 'workspace' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y php7.0-cli php7.0-common php7.0-curl php7.0-json
php7.0-xml php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-pgsql php7.0-sqlite php7.0-sqlite3 php7.0-zip php7.0-memcached
sqlite3 libsqlite3-dev git curl vim nano nodejs nodejs-dev npm' returned a non-zero code: 100
I am on windows system
This repository is so good it replaced all my homestead instances....
The problem I am facing is that laradock only runs once with docker-compose up
on machine default
. If I have several sites I want to work on, docker-compose-up will shut down the other containers.
What is the best solution - do I want a docker-machine
for each docker-compose
? I thought changing ports would work but it does not.
Upgrade phusion/baseimage
to the latest version
I need video tutorial to understand it
run docker-compose up
,than blow:
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
docker-compose -v
docker-compose version 1.6.2, build 4d72027
The step:9 - Finally run the containers. Make sure you are in the docker folder before running this command.
When I run the command blow,there is a error :command not found: docker-compose
docker-compose up -d
And if I run docker -v
,reponse blow:
Docker version 1.10.1, build 9e83765
Could there is anyone do me a favor?
I have been looking for a Laravel docker, and yours is the best documented & updated. Thanks for sharing.
I would love to be able to reuse my existing laravel code, but this is not configurable from the documentation, this would make sense if we are migrating an existing project from Vagrant.
In addition, it would be great to have a mongodb available as well. I'm just getting started with docker, and would love to see what is the process when adding a new software to docker-compose, and how you integrate them.
Excellent work, thanks.
I have recently switched from Laravel Homestead to Laradock and it is awesome, but I can't figure out how to create multiple sites and add phpmyadmin. Has someone achieved it? Thanks in advance.
Need a MongoDB Docker container.
add crontab and supervisor support
if we need to run a full-featured laravel application
we need to add laravel crontab setting to system . reference: https://laravel.com/docs/5.2/scheduling
eg:
* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1
and optionally we need to add The Queue Listener to the System by supervisor .
reference: https://laravel.com/docs/5.2/queues#supervisor-configuration
eg:
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /home/forge/app.com/artisan queue:work sqs --sleep=3 --tries=3 --daemon
autostart=true
autorestart=true
user=forge
numprocs=8
redirect_stderr=true
stdout_logfile=/home/forge/app.com/worker.log
if we have multiple application we may need a mapping folder like nginx site-avaiable to store supervisor conf.d config files.
I'm not being able to reach my laravel, what could be the reason?
Where should I run "php artisan" commands?
When I run it with "docker-compose up -d" , does it get the mysql configuration (username and password) from my .env file?
Laradock looks great and looks like something we would use to deploy our Laravel projects using Docker however I get an error when running the project on MAC OSX El Capitan.
I get the following error when trying to bring up the image:
Illegal instruction: 4
Is this because the project was written for an older version of MAC OSX?
I get the following when I try to migrate the database on postgres.
root@bc0a9189bfdd:/var/www/laravel# php artisan migrate:refresh --seed
[PDOException]
could not find driver
It's missing the postgres driver, though the PHP-FPM one is installed fine, it's an easy fix, but I'm struggling with multiple pull requests, I keep missing up and getting all commits into one PR.
RUN docker-php-ext-install pdo_pgsql
ERROR: for application Container command 'true' not found or does not exist.
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "compose\cli\main.py", line 63, in main
AttributeError: 'ProjectError' object has no attribute 'msg'
docker-compose returned -1
I didn't change default in docker-compose.yml
application: build: ./application volumes: - ../:/var/www/laravel
I cloned laradock repo inside my existing laravel repo. Laradock folder is in there.
username@pc MINGW64 /c/xampp/htdocs/1/zemke2/laradock (master) $ ls .. -a ./ .gitignore composer.lock node_modules/ server.php ../ .gitmodules config/ package.json storage/ .env app/ database/ phpspec.yml tests/ .env.example artisan* gulpfile.js phpunit.xml vendor/ .env_1.example bootstrap/ laradock/ public/ .git/ bower.json LICENSE README.md .gitattributes composer.json nbproject/ resources/
And when i ssh into container laradock is the only folder in there?
username@pc MINGW64 /c/xampp/htdocs/1/zemke2/laradock (master) $ docker exec -it laradock_workspace_1 bash root@1a20519ccc78:/var/www/laravel# ls -a . .. laradock root@1a20519ccc78:/var/www/laravel# exit exit
Pastebin with nicer formatting http://codepad.org/79BRcwrb
Docker installation appears correct but I can't up
the container.
(is my first experience with docker)
Bellow: run hello-world
, compose-up
and service status
# sudo docker-compose up -d php nginx mysql
Unsupported config option for services service: 'php'
# sudo docker run hello-world
Hello from Docker.
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
# sudo service docker status
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Seg 2016-05-09 11:51:31 BRT; 32min ago
Docs: https://docs.docker.com
Main PID: 14963 (docker)
CGroup: /system.slice/docker.service
├─14963 /usr/bin/docker daemon -H fd://
└─14968 docker-containerd -l /var/run/docker/libcontainerd/docker-containerd.sock --runtime docker-runc
Mai 09 12:10:49 atlantis docker[14963]: time="2016-05-09T12:10:49.597980312-03:00" level=info msg="No non-localhost DNS nameservers are left in resolv... 8.8.4.4]"
Mai 09 12:10:49 atlantis docker[14963]: time="2016-05-09T12:10:49.598038718-03:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers ...60::8844]"
Mai 09 12:15:15 atlantis docker[14963]: time="2016-05-09T12:15:15.996799926-03:00" level=info msg="No non-localhost DNS nameservers are left in resolv... 8.8.4.4]"
Mai 09 12:15:15 atlantis docker[14963]: time="2016-05-09T12:15:15.996842607-03:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers ...60::8844]"
Mai 09 12:18:12 atlantis docker[14963]: time="2016-05-09T12:18:12.873627344-03:00" level=info msg="No non-localhost DNS nameservers are left in resolv... 8.8.4.4]"
Mai 09 12:18:12 atlantis docker[14963]: time="2016-05-09T12:18:12.873664671-03:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers ...60::8844]"
Mai 09 12:20:15 atlantis docker[14963]: time="2016-05-09T12:20:15.750808986-03:00" level=info msg="No non-localhost DNS nameservers are left in resolv... 8.8.4.4]"
Mai 09 12:20:15 atlantis docker[14963]: time="2016-05-09T12:20:15.750861523-03:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers ...60::8844]"
Mai 09 12:20:21 atlantis docker[14963]: time="2016-05-09T12:20:21.872485224-03:00" level=info msg="No non-localhost DNS nameservers are left in resolv... 8.8.4.4]"
Mai 09 12:20:21 atlantis docker[14963]: time="2016-05-09T12:20:21.872527121-03:00" level=info msg="IPv6 enabled; Adding default IPv6 external servers ...60::8844]"
Hint: Some lines were ellipsized, use -l to show in full.
Hi,
I built the nginx, php, mariadb and data containers but I see the "Welcome to Nginx" default page when opening the http://localhost URL in the browser.
I use the Docker Beta software instead of the Docker Machine. Do you know what could be the problem?
$ ifconfig docker0 | grep 'inet' | cut -d: -f2 | awk '{ print $1}' | head -n1
With this you will get only the IP-Address without any other informations.
I have an error described in docker/compose#3451
Here is what I was trying to do:
$ docker-compose up -d nginx mysql redis workspace
Starting laradock_data_1
Starting laradock_application_1
ERROR: for application argument of type 'NoneType' is not iterable
ERROR: for data argument of type 'NoneType' is not iterable
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "compose/cli/main.py", line 57, in main
File "compose/cli/main.py", line 108, in perform_command
File "compose/cli/main.py", line 728, in up
File "compose/project.py", line 395, in up
File "compose/parallel.py", line 60, in parallel_execute
TypeError: argument of type 'NoneType' is not iterable
docker-compose returned -1
Any suggestions?
I use script.sh to get the shell quickly connected to the docker daemon, with the exception that you need to copy and paste eval "$(docker-machine env default)"
as the shell script will not execute for some reason. I am sure someone will know. This allows me to bypass the quickstart terminal.
#!/usr/bin/env bash
docker-machine start default
docker-machine ip default
docker-machine env default
# this is not working: eval "$(docker-machine env default)"
Additionally I use remove_containers.sh
which comes in handy when you mess up repeatedly. Also connection to container scrips like php.sh
, mysql.sh
as I can't ever remember the commands.
Would these be a good fit for this repository? I know I use them and love them. I think I found them on stackoverflow.
By the way awesome job, this is the only setup that got a development machine running!
Like Laravel Homstead but for Docker instead of Vagrant.
should be
Like Laravel Homestead but for Docker instead of Vagrant.
For testing purposes with hello api it would be nice to have sql lite embedded into the container.
Hello,
when I run this, I get:
mysql | 160403 7:23:03 InnoDB: Using Linux native AIO
mysql | 160403 7:23:03 InnoDB: Initializing buffer pool, size = 128.0M
mysql | 160403 7:23:03 InnoDB: Completed initialization of buffer pool
mysql | 160403 7:23:03 InnoDB: highest supported file format is Barracuda.
php-nginx | Interactive shell
php-nginx |
data exited with code 0
mysql | 160403 7:23:03 InnoDB: Waiting for the background threads to start
php-nginx exited with code 0
mysql | 160403 7:23:04 InnoDB: 5.5.47 started; log sequence number 1595675
As you can see, mysql, (redis earlier) started..
but nginx an data containers - exited.
ANy ideas?
Getting this error on a fresh docker machine when accessing my site:
RuntimeException in EncryptionServiceProvider.php line 29: No supported encrypter found. The cipher and / or key length are invalid.
I've tried generating a new key, clearing cache, recompiling, restarting the containers, etc. This exact same project works flawlessly on my Vagrant box.
Any ideas?
I want to use the redis as the cache/session driver and open the .env
file to rewrite CACHE_DRIVER
and SESSION_DRIVER
CACHE_DRIVER=redis SESSION_DRIVER=redis
But when I open the 192.168.99.100,the laravel reports the problem like this:
FatalThrowableError in Database.php line 62: Fatal error: Class 'Predis\Client' not found
What's the problem with the redis?
Hello there Mahmoud!
I'm having an issue while trying to set up Laradock.
When I do a
docker-compose up -d nginx mysql redis workspace
I'm getting an error on the apt-get update command on line 15 of the Workspace Dockerfile.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/source/Sources Hash Sum mismatch
I tried running
rm /var/lib/apt/lists/* -vf
in the Dockerfile before the update, but I'm still getting the same error.
Any ideas?
i want to develop more than laravel project in the same time in the laradock docker...
how can i do this...
Workspace container has an issue, laravel global installer isn't finding composer, will look into it soon:
root@bc0a9189bfdd:/var/www/laravel# laravel new project
Crafting application...
sh: 1: composer: not found
Application ready! Build something amazing.
Though composer is installed all good.
root@bc0a9189bfdd:/var/www/laravel# composer -V
Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
Composer version 1.1.1 2016-05-17 12:25:44
Right now both PHP and NGINX are installed on the same container.
Let LaraDock be used by any PHP developer, not only Laravel developers.
By default it should be configured to run any PHP at a general directory www/
and then depend on your framework, you should do a little modification (Nginx configuration..) to make it work.
Start by supporting: Symfony, CakePHP, Yii, Codeigniter, Slim, Lumen, Zend and of course Laravel. Then we'll cover other frameworks.
i am currently using Vagrant with homestead building
and try to migrate to docker.
Can you support for HHVM and mariadb ?
can we use Postgres right now with laradock ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.