Skip to content

Instantly share code, notes, and snippets.

@cjdell
Last active May 12, 2018 13:25
Show Gist options
  • Save cjdell/1179769823b7305713aea30562e5836d to your computer and use it in GitHub Desktop.
Save cjdell/1179769823b7305713aea30562e5836d to your computer and use it in GitHub Desktop.
Docker Cheatsheet

INSTALL

Install Docker from here...

https://store.docker.com/editions/community/docker-ce-desktop-mac

SHELL 1

Change directory to a location containing a copy of WordPress (i.e. a folder container a wp-config.php file).

docker pull fauria/lamp

docker run --rm -p 8080:80 -p 3306:3306 -e LOG_STDOUT=true -e LOG_STDERR=true -e LOG_LEVEL=debug -v $(pwd):/var/www/html --name my-wordpress fauria/lamp

Leave this running...

SHELL 2

docker exec -ti my-wordpress /bin/bash

mysql

CREATE DATABASE wordpress;
CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'wordpress'@'localhost';
FLUSH PRIVILEGES;

Browse to http://localhost:8080/ and run install with DB name/user = 'wordpress' and password = 'password'

To kill container...

docker kill my-wordpress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment