Create a development environment for Laravel in Docker

I have a custom Laravel installation on my Ubuntu machine. As per Laravel’s instructions however, I didn’t use Homestead to spin up my app. Instead I installed the app using composer on my machine and then installed the dependencies and libraries as per the requirement.

Now I want to use another machine for development. How’s it possible using Docker to package a replica of my machine’s environment to create a container to be used on the other machine. I am new to Docker and haven’t used it before for whatsoever reasons.

  • Docker. How to resume downloading image when interrupted?
  • Docker volume command line option mistaking files for directories
  • Docker issue commands to an app inside container?
  • Windows Server 2016 docker image default username/password
  • GAE Managed VMs - can't deploy if your project name is too long
  • How MongoDB works with Docker
  • Dockerfile compile in local machine but fails in docker hub for automated build
  • Is it possible to run my meteor tests in docker?
  • sonatype nexus docker volume error
  • How do I correctly specify the **FROM** value to be my local image and not from a Docker Hub registry?
  • how to mount localhost volume to a docker container using docker-compose
  • docker nginx 502 bad gateway
  • 2 Solutions collect form web for “Create a development environment for Laravel in Docker”

    Have you considered using Laravel Valet? It’s a lot more light weight than Docker and Homestead and can spin up your projects almost instantaneously.

    If you wish to persist with Docker then Laradock has probably figured out most of what you wish to use.

    I created a barebones Docker Compose repo that can be used for Laravel or as a LAMP Server and it comes with:

    • Apache
    • PHP
    • MySQL
    • Composer
    • PHPMyAdmin

    Most of the ones I came across are pretty bloated with stuff that I didn’t need.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.