Skip to content

Hello World

John Cleary edited this page Oct 1, 2016 · 6 revisions

If you haven't already done so, you'll need to create a default machine:

> docker-machine create -d virtualbox default

Check to see if the default machine is running:

> docker-machine start default

Load up the environment variables for docker and docker-compose:

> eval $(docker-machine env default)

Run echo "Hello World!" in a container using the ubuntu image:

> docker run ubuntu /bin/echo "Hello World”

Check to see if any containers are running:

> docker ps

Create a phpinfo page run it in a container using the PHP 7.0 image:

> echo "<?php phpinfo();" > index.php
> docker run -d -p 80:80 --name php-hello-world -v "$PWD":/var/www/html php:7.0-apache

asciicast

Clone this wiki locally