This article is going to show steps and configurations on how to build a development box (PHP CodeIgniter + Apache + PostgreSQL) using Docker on Windows.

Why Docker

  • Comparing to VirtualBox, it’s a lot easier and probably faster
  • Portable.

Files to prepare

1. Install Docker for Windows. Unfortunately native Docker is only available on Windows10 so all other Windows have to use Docker Toolbox which is based on VirtualBox.

2. Prepare your folder structure for your project. Note when using “Docker Toolbox”, you’ll need to put your project folder under your home folder which is normally c:\users\USERNAME on Windows (Native Docker allows you to change this to other place)

Below is my project folder

 

 

 

 

 

 

3. Create files

  • Dockerfile

  • Apache vhost.conf

  • Docker-compose.yml

4. Build Docker images.

5. Start Docker container. Docker container is a running instance of a Docker image. Load balancing is supported by running multiple containers of the same image (we don’t use this feature here)

6. Done

7. Common commands

  • docker-compose build
  • docker-compose build
  • –list Docker containers
  • docker ps
  • –connect to a Docker container
  • docker exec -it container_name bash

 

 

 

Building a development box on Docker
Tagged on:                     

Leave a Reply

Your email address will not be published. Required fields are marked *

85 − = 82

This site uses Akismet to reduce spam. Learn how your comment data is processed.