Skip to content

Instantly share code, notes, and snippets.

@alemohamad
Last active August 29, 2015 14:22
Show Gist options
  • Save alemohamad/7869002c699f8e1a4033 to your computer and use it in GitHub Desktop.
Save alemohamad/7869002c699f8e1a4033 to your computer and use it in GitHub Desktop.

Docker

Docker

Install Docker

# 1. After downloading and installing Boot2Docker, we have to prepare the environment
$ boot2docker init
$ boot2docker up
$ eval "$(boot2docker shellinit)"

# 2. Install Docker Compose
$ curl -L https://github.com/docker/compose/releases/download/1.2.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose

# 3. Prepare the folders and files (view how the structure is @ "Docker for PHP Developers")
#    It's important to have defined a 'docker-compose.yml' file

# 4. Create Docker container
$ docker-compose up -d
# Find out which Docker containers are running
$ docker ps

# Enter that Docker container through bash
$ docker exec -it [CONTAINER_ID] /bin/bash

# Read Docker logs
$ docker-compose logs

# Stop and delete a Docker container
$ docker stop [CONTAINER ID]
$ docker rm [CONTAINER ID]

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment