Here is a getting started guide for Docker:
https://docs.docker.com/get-started

Docker for Windows/Mac offers more integration with the host operating system 
but it conflicts with VirtualBox (which we use for Vagrant).

If you just want to use Docker inside a Linux VM, running `vagrant up` on 
GPII/universal will get that for you. You can then share files outside the VM 
using shared folders (/home/vagrant/sync). That's because our CentOS/Fedora 
vagrant boxes already come with Docker pre-installed.

Some basic commands are here: 
https://github.com/GPII/universal/blob/master/scripts/vagrantCloudBasedContainers.sh

This is the script CI uses to run the integration tests. You can see at the end 
that there only a few commands that actually do something:


# Build GPII/universal image
docker build -t universal .

# Run CouchDB in a container
docker run -d -p 5984:5984 --name couchdb couchdb

# Load Preferences data into CouchDB database
docker run --rm --link couchdb -v 
/home/vagrant/sync/universal/testData/preferences:/data -e 
PREFERENCES_DIR=/data -e COUCHDB_URL=http://couchdb:5984/preferences -e 
CLEAR_INDEX=1 gpii/preferences-dataloader

# Run Preferences Server
docker run -d -p 9081:9081 --name preferences --link couchdb -e 
NODE_ENV=gpii.config.preferencesServer.standalone.production -e 
GPII_PREFERENCES_DATASOURCE_URL=http://couchdb:5984/preferences/%userToken -e 
GPII_PREFERENCES_LISTEN_PORT=9081 universal

# Run Flow Manager
docker run -d -p 9082:9082 --name flowmanager --link preferences -e 
NODE_ENV=gpii.config.cloudBased.flowManager.production -e 
GPII_FLOWMANAGER_PREFERENCES_URL=http://preferences:9081/preferences/%userToken 
-e GPII_FLOWMANAGER_LISTEN_PORT=9082 universal


We can hide this behind automation, improve this script, etc, but I'll argue 
that it's still useful to understand how to work with Docker since that's 
what's used in actual deployments.

I understand we're all swamped learning new tools everyday but this one won't 
take much time and it's worth it, IMHO.

Regards,
Giovanni
_______________________________________________
Architecture mailing list
[email protected]
https://lists.gpii.net/mailman/listinfo/architecture

Reply via email to