Setting up Your Local Docker¶
The steps to setup the DKAN development environment are as following:
- Run the universal Docker installer (recommended) and/or run the commands manually to make sure that the Docker Machine is properly setup.
- Make sure the Docker Machine is started
- Clone DKAN, install it in Docker Machine and start developing. Or clone a dkan_starter project, install it in Docker Machine and start developing.
- Universal Docker Installer
1. Universal Docker Installer¶
The universal Docker installer is available in the Universal Installer repository. Check the Readme on the Github repository to setup the docker development environment.
1.1 Setup the installer dependencies¶
https://github.com/NuCivic/universal-docker-installer#installer-dependencies
1.2 Environment setup¶
1.3 Troubleshooting¶
https://github.com/NuCivic/universal-docker-installer#troubleshooting
2. Docker machine¶
Before starting to work on DKAN sites, the developer needs to make sure that the development docker machine is up and running as following:
docker-machine status default
docker-machine start default
When the developer is done developing DKAN, the docker machine could be checked and stopped as following:
docker-machine status default
docker-machine stop default
To manage the default Virtualbox machine (the docker machine), a developer can use the following commands:
- Check the machine status:
docker-machine status default
- List the existing docker machines:
docker-machine ls
- Start the default machine:
docker-machine start default
- Stop the default machine
docker-machine stop default
- Check the default machine IP address
docker-machine ip default
- SSH into the default machine:
docker-machine ssh default
For a detailed docker-machine command line reference check the following link: https://docs.docker.com/machine/reference/
3. Getting started with DKAN development¶
To get started with DKAN development you need to follow these steps:
cd ~/docker
git clone git@github.com:GetDKAN/dkan.git
cd dkan
bash dkan-init.sh dkan
ahoy docker up
ahoy dkan drupal-rebuild mysql://drupal:123@db/drupal
ahoy dkan remake
ahoy dkan reinstall
ahoy docker url
ahoy docker vnc (to get the vnc url and use it with any vncviewer. The password is secret).
ahoy dkan test
Visit the DKAN site url to be sure the site is up and reachable.
In the dkan folder you can see the following directories:
dkan/
: The git repository of dkan profiledocroot/
: The docroot with a fresh Drupal installation and a symlink from docroot/profiles/dkan to dkan (git repository)backups/
: Contains SQL backup/dump file (last_install.sql) for the last DKAN site reinstall.
Make changes to dkan, add, commit and push.
When done developing for this project execute the following command: ahoy docker stop
When done developing with Docker Machine for any DKAN related project execute the following command: docker-machine stop default