Skip to content

Instantly share code, notes, and snippets.

@tonysm
tonysm / laradock.md
Last active September 6, 2017 11:54

On using Laradock

Laradock is a community maintained set of Docker containers that we can use in our projects. Here I'm going to show what it takes to a couple of projects running usinng the same laradock setup.

Setting up

I'm not gonna be building anything new here, so I'm going to create two new laravel applications:

laravel new project-a --dev
1. Create new container
a) docker run -i -t ubuntu /bin/bash
b) docker run --name rails_dev_container -i -t ubuntu ubuntu /bin/bash
The command line flags - i -t provide an interactive shell in the new container
2. Show running docker containers ==> docker ps
3. Show list of current containers ==>
a) docker ps -a (Show all containers, both stopped and running)
b) docker ps -n x (shows the last x containers, running or stopped, ex: docker ps -n 5)