Install Docker

Windows

Download the Docker Desktop Installer and run it.

Possible Installation Problems

macOS

Simply download the Docker Desktop Installer and run it.

Linux

On this page, click on your Linux distro and follow the instructions.

Run the Docker Container

Windows

  1. Open a PowerShell with administrator privileges (instructions)
  2. Go to the root of your C drive: cd c:\
  3. Create a new folder html, for your website files: mkdir html
  4. Without closing the PowerShell window, open you favorite code editor (I recommend Visual Studio Code) and create an HTML file with the following content:
     <!DOCTYPE html>
     <html lang="en" dir="ltr">
         <head>
             <meta charset="utf-8">
             <title>Hello World</title>
         </head>
         <body>
             <h1>Hello World!!!</h1>
    
             <a href="#teste">Test link!</a>
         </body>
     </html>
    
  5. Save the file with the name index.html inside the folder you created earlier (C:\html)
  6. Go back to the PowerShell window and run a Docker container:
     docker run -d -p 9000:8080 -it --name=php -v C:\html:/var/www/html gfcg/vesica-php73:dev
    
  7. To check if your container is running correctly, use your browser to navigate to http://localhost:9000. You should see the following:
  8. From now on, whatever you put in the html folder, should be accessible via the browser in http://localhost:9000. You can start building your website by placing your files in the html folder!



Linux / Mac

  1. Open a terminal and create a new html folder, for your web files: mkdir ~/html (~ means your home folder)
  2. Open you favorite code editor (I recommend Visual Studio Code) and create an HTML file with the following content:
     <!DOCTYPE html>
     <html lang="en" dir="ltr">
         <head>
             <meta charset="utf-8">
             <title>Hello World</title>
         </head>
         <body>
             <h1>Hello World!!!</h1>
    
             <a href="#teste">Test link!</a>
         </body>
     </html>
    
  3. Save the file with the name index.html inside the folder you created earlier (~/html)
  4. Go back to the terminal and run a Docker container:
     sudo docker run -d -p 9000:8080 -it --name=php -v ~/html:/var/www/html gfcg/vesica-php73:dev
    
  5. To check if your container is running correctly, use your browser to navigate to http://localhost:9000. You should see the following:
  6. From now on, whatever you put in the html folder, should be accessible via the browser in http://localhost:9000. You can start building your website by placing your files in the html folder!

Remove the Docker Container

To remove the Docker container, you can run:

docker rm -f php

Note that removing the container will not remove the files you have created in your html folder, because we are using a Docker volume to persist the files (this volume is created by the use of the -v option in the docker run command).