Docker Download Links
Getting Ready to Install
I personally use a Mac so this tutorial will be mainly following my process. I assume the steps for Windows will be similar and Docker provides Linux users steps to get it running on your device!
For this tutorial I will focus on cloning a GitHub repository and creating a build of it into Docker. I will be using the HaxCms repo in the example.
Prior to the installation, make sure to clone your repo onto your device.
if you are unsure on how to clone your repo follow this tutorial provided by Github
Installation Steps
- Install Docker onto your device
- Open Docker Desktop once you complete the installation
- Create an account (or login to an existing account)
How to Build an Image and Run it
To begin, we will be using that repo cloned earlier.
- Open your terminal
- Go to the file of your GitHub repo using
cd {file path}
- Enter
docker build . -t {name of build}
Since I was installing HAXCms, I named my build "hax" so the command I entered wasdocker build . -t hax
- In order to run the container, use
docker run -dp 80:80
or go into docker and select using port 80.
The nice thing about Docker is when you go to run your build, this window will pop up.
Enter the 80 onto the Local Host portion of this pop up.
- Open your browser of choice and enter
localhost:80
if you selected a different port, enter the number that reflects it in the local host
Since I used Mac, I did notice that when I attempted to run HaxCms it would not work on Safari but did work on Chrome! So if you are a Mac user as well and having trouble with it on Safari, try to switch over to Chrome.
- Once the site runs, you should see your build! In this case I saw this screen.
Stopping the container
This is pretty simple! Just open Docker Desktop once again and find the current container that is running. A small menu on the right should be there, one of the options is stop.
Top comments (0)