Public | Automated Build

Last pushed: a year ago
Short Description
Docker image for Laravel Homestead
Full Description


Docker image for Laravel Homestead

WIP (work in progress)

RUN Kitematic and Docker Quickstart Terminal as Administrator and symlinks will be OK

I'm trying to build a docker image as close as it possible to original Homestead vagrant image. I even use Ubuntu's upstart which is officially not supported by docker. Here is the dump

root@5957f82f7e59:/# service --status-all
[ - ]  apparmor
[ - ]  blackfire-agent
[ ? ]  console-setup
[ - ]  cron
[ - ]  dbus
[ ? ]  killprocs
[ ? ]  kmod
[ ? ]  mysql  (? but it's OK)
[ ? ]  networking
[ + ]  nginx
[ ? ]  ondemand
[ + ]  php7.0-fpm
[ - ]  procps
[ ? ]  rc.local
[ + ]  resolvconf
[ - ]  rsync
[ - ]  rsyslog
[ ? ]  sendsigs
[ - ]  sudo
[ - ]  supervisor
[ - ]  udev
[ ? ]  umountfs
[ ? ]
[ ? ]  umountroot
[ - ]  unattended-upgrades
[ - ]  urandom
[ - ]  x11-common

Keeping usual homestead user and password
user: vagrant
password: vagrant

Customization is another vital point here. Every time you upgrade your homestead base image, you lose every change you have made on your VM. It's very natural to do so, as you don't upgrade the base image frequently, treat your VM as stable environment, until one day... boom!
There is no way to keep the changes, unless you're willing to do some extra provisioning, which never worked for me as I expected. Docker solves this problem because of the containers disposable nature. You can build your custom images on top of this one and keep your changes over any upgrades. Just don't install anything inside a running container, always do it in the Dockerfile and you will keep everything every time you run it.

Installing new Laravel application could be a relatively long process. To speed things up I bundled default app in archive. On the first run Docker will extract the default app and regenerate the key, so you can run your first app in seconds.

run with -d otherwise you'll hang your terminal

default app location
if it isn't present, default Laravel app will be installed

Midnight Commander as a bonus
mc -a

based on
The scripts that build the Laravel Homestead development environment.

similar projects:

I like currently available projects, they are a great source for inspiration.
They use mixed approaches with docker images and compose, some of them implement some homestead features, but not all of them.
I'm trying to build an exact copy of Laravel Homestead in one monstrous docker image, which is not the canonical docker way of doing things, but it's a quick hack to get you started with Laravel.

If you're looking for a better docker solution, I have another project
LaraWhale It's more like Lego blocks to build you custom environment picking a webserver, database, queue, etc.
With LaraWhale you could build something very similar to Homestead, but I couldn't say it would be exact copy of Homestead.


  • [ ] install Laravel by default
  • [ ] run acceptance tests
  • [ ] mysql
  • [ ] postgresql
  • [ ] add yaml config similar to Homestead.yaml
Docker Pull Command
Source Repository

Comments (0)