Let's assume that you're starting with a Dockerfile - and the bravery to start.
Mac/Windows requires that Docker runs from a VM (:cry:), so the best approach is using Docker Toolbox.
- Install Docker Toolbox (download it, then click next till the end of the world);
docker-machine create --driver virtualbox AWESOME_VMto create a new environment. You can name it the way you like 😉.- PROFIT!
docker-machine lsto list your VMs. You can have as many VMs as you wish and switch from one. AWESOME!
In order to start your VM, use these wise tips:
docker-machine stop AWESOME_VMto start;docker-machine start AWESOME_VMto shut it down;docker-machine rm AWESOME_VMto destroy it
.
docker-machine ssh AWESOME_VM
- Navigate to
/Users/path/to/your/Dockerfile; docker build -t AWESOME_IMAGE .
- Once the Docker is properly builded, run
docker run -i -t -p 80:80 -p 443:443 AWESOME_IMAGE /bin/bashto access the image and start the fun.