{"id":20859142,"url":"https://github.com/daemonite/workbench","last_synced_at":"2025-10-29T06:42:37.754Z","repository":{"id":147237185,"uuid":"44291208","full_name":"Daemonite/workbench","owner":"Daemonite","description":"Daemonite Docker Development Workbench","archived":false,"fork":false,"pushed_at":"2016-11-08T11:49:20.000Z","size":332,"stargazers_count":4,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-19T07:25:18.682Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Daemonite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-10-15T03:19:48.000Z","updated_at":"2019-11-20T20:00:41.000Z","dependencies_parsed_at":"2024-01-30T04:11:09.514Z","dependency_job_id":null,"html_url":"https://github.com/Daemonite/workbench","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daemonite%2Fworkbench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daemonite%2Fworkbench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daemonite%2Fworkbench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daemonite%2Fworkbench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Daemonite","download_url":"https://codeload.github.com/Daemonite/workbench/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243230090,"owners_count":20257644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T04:48:46.987Z","updated_at":"2025-10-29T06:42:32.719Z","avatar_url":"https://github.com/Daemonite.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Daemonite Docker Development Workbench\n\nThe team has moved to a GO based app to replace Vagrant:\n\nhttps://github.com/justincarter/docker-workbench\n\n`docker-workbench` is a utility for simplifying the creation of Docker-based development environments in VirtualBox with `docker-machine`.\n\nThe primary goals of `docker-workbench` are;\n\n1. To make it easy to create Docker machines in VirtualBox with sensible defaults (CPUs, disk size, RAM, etc)\n2. To make it easy to run multiple containerised web applications without managing DNS, hosts files or ports\n3. To provide a standard `/workbench` shared folder to allow `docker-compose` volumes work the same for multiple users, cross-platform\n4. To allow mobile, tablet and other network devices to easily access the containerised applications\n\nEnjoy!\n\nPS. Go here https://github.com/justincarter/docker-workbench\n\n\n----\n\n# WARNING: Our *old* Vagrant based approach follows\n\n_Note this is a documentation project for setting up a dockerised development environment with Vagrant and Virtualbox.  Don't just clone and run because you won't get far ;)_\n\n## Installation\n\n1. install Git client (\u003e1.6.5)\n\n2. install Virtualbox (\u003e5.x)\n   If you are on Windows it's worth checking to see if there is a preferred build for the Windows version you are on; Virtual Box seems to have an ongoing love/hate relationship with Windows OS.\n\n3. install [Vagrant (\u003e1.7.4)](https://www.vagrantup.com/downloads.html)\n   Vagrant is used to programatically control the configuration of our Docker VM.\n\n4. install hostmanager plugin: \n   Hostmanager automatically updates your host file and puts in a \"workbench.dev\" entry for the virtual machine.\n\n   `$ vagrant plugin install vagrant-hostmanager`\n5. create a local projects directory (can be called anything): `$ mkdir ~/Workbench`\n\n   `$ mkdir ~/Workbench`\n6. copy [Workbench VM Vagrantfile](https://github.com/Daemonite/workbench/blob/master/Vagrantfile) into `~/Workbench` directory\n   https://github.com/Daemonite/workbench/blob/master/Vagrantfile\n\nTest installation and make sure everything is running by bringing up the Workbench DockerUI view:\n```\ncd ~/Workbench\nvagrant up\nopen http://workbench.dev:81\n```\n\n_Note, you may be prompted for your admin password by `hostmanager` when it attempts to update your local hosts file._\n\n![DockerUI](./images/wb-dockerui.jpg)\n\nTest drive a project, you will need a HOST entry pointing at the workbench IP (172.22.22.22) for chelsea-docker.dev:\n```\ncd ~/Workbench\ngit clone --recursive git@github.com:modius/chelsea-docker.git\ncd chelsea-docker\nvagrant up --no-parallel\nopen http://chelsea-docker.dev\n```\n\n_Note, all workbench projects run from *.dev so if you can wildcard that entry with DNSMASQ or equivalent so much the better._\n\n![Chelsea: FarCry Core](./images/wb-chelsea.jpg)\n\n## Workbench Cheat Sheet\n\n### Global Workbench \n`cd ~/Workbench`\nYou need to be in the same directory as the Vagrantfile for workbench.\n\n`vagrant up workbench`\nMake sure the central work bench VM is running; its where the magic happens.\n\n`vagrant global-status`\nCheck to see what's running and what's not running.\n\n`vagrant provision workbench`\nClear out all running containers, and re-provision. Useful if something has gone wrong building a container.\n\n`vagrant ssh workbench`\nSSH onto the Boot2Docker VM and muck around.\n\n### Project Specific\n`$ cd ~/Workbench/my-env-project`\nYou need to be in the same directory as the Vagrantfile for your Project.\n\n`vagrant up --no-parallel`\nBring up the default project containers sequentailly; makes sure your containers come up in the right order if they're linked.\n\n`vagrant status`\nCheck the details of your specific project; what's running, container names, etc.\n\n`vagrant reload mycontainer`\nRebuild your project's Docker image and start the container.\n\n`vagrant docker-logs`\nTail the logs of all the containers running in your project.\n\n\n\n## Overview\n\nThe Workbench assumes a simple hierarchy of Docker projects.  Each app or Docker image is isolated in its own Git repo.  Developers clone environment repos into their Workbench folder.\n\n```\n~/Workbench\n├── Vagrantfile \u003c-- Boot2Docker VM\n├── aoc-env-corporate \u003c-- git repo\n│   ├── Dockerfile\n│   ├── README.md\n│   ├── Vagrantfile\n│   ├── code\n│   ├── config\n│   └── logs\n├── aoc-env-mediacentre \u003c-- git repo\n│   ├── Dockerfile\n│   ├── README.md\n│   ├── Vagrantfile\n│   ├── code\n│   ├── config\n│   └── logs\n└── aoc-env-rio2016 \u003c-- git repo\n    ├── Dockerfile\n    ├── README.md\n    ├── Vagrantfile\n    ├── code\n    ├── config\n    └── logs\n```\n\nAt the root of the Workbench folder is a Vagrantfile that defines the Workbench VM; Boot2Docker provisioned with useful tools.  Each environment project has its own Vagrantfile that looks for the shared Workbench VM (./Workbench/Vagrantfile) where it builds and deploys containers.\n\nThe makeup of a specific project environment repo is detailed in the specific README of each project skeleton; for example, Lucee Workbench or FarCry Workbench.\n\n## Working with Workbench\n\nWorkbench uses a modern [Boot2Docker VM](https://github.com/dduportal/boot2docker-vagrant-box) to manage a Docker host for development. You can interact with this Docker host directly via a Docker client, by logging onto the VM or through Vagrant.\n\nIf you are new to Docker, it might be easier sticking to the simplified Vagrant commands before advancing to native Docker commands.\n\n### Starting the Workbench\n\nWorkbench projects share a central VM called **workbench**. First thing you need to do is to get this running:  \n\n```\ncd ~/Workbench\nvagrant up workbench\n```\n\n_Note, the first time you start a **workbench** VM it may have a bit of work to do to get everything in place; downloading the VM box, downloading common Docker images, and setting things up. Subsequent start-ups will be **much** faster._\n\nYou can see the status of the **workbench** virtual machine (VM) at any time by checking which VMs are running:\n```bash\n$ vagrant global-status\nid       name            provider   state              directory                                 \n-------------------------------------------------------------------------------------------------   \na8cd80e  dockerhost      virtualbox poweroff           /Users/modius/Workbench/bng-env-spp            \n61dddef  spp             docker     host state unknown /Users/modius/Workbench/bng-env-spp            \ne65746b  workbench       virtualbox running            /Users/modius/Workbench                        \n6564df4  mysql           docker     running            /Users/modius/Workbench/gpml-env-prime         \n6e8e8cb  gpml-solo       docker     running            /Users/modius/Workbench/gpml-env-prime         \n97bfa2b  farcrycore-solo docker     running            /Users/modius/Workbench/dae-env-farcrycore     \n82db5d9  mysql           docker     running            /Users/modius/Workbench/dae-env-farcrycore     \n8bf934f  mysql           docker     running            /Users/modius/Workbench/dae-env-daemon         \n63e99df  daemon-solo     docker     running            /Users/modius/Workbench/dae-env-daemon         \n```\n\nIf you are in the root directory of a specific environment project you can check the status of that specific project:\n```\n$ cd ~/Workbench/gpml-env-prime\n$ vagrant status\nCurrent machine states:\n\ngpml                      not created (docker)\nmysql                     running (docker)\ngpml-solo                 running (docker)\ndockerhost                poweroff (virtualbox)\n```\n\n_Note, the **dockerhost** VM is a backup host that you can run in the absence of the central **workbench** VM; for example, if you only have the environment project and not the whole Workbench set up.  If you are using the **workbench** VM the **dockerhost** VM is redundant. If you have a **dockerhost** VM running you can safely stop it with `vagrant halt dockerhost` or even destroy it with `vagrant destroy dockerhost`._\n\nAlso, have a look at the internals of your Workbench by running the Docker UI that is provisioned by default when the **workbench** starts:\n```\nopen http://workbench:81\n```\n\n### Starting your development environment\n\nThe specific project you are working on controls the behaviour of your development environment. Switch to your project folder and start its containers:\n\n```\ncd ~/Workbench/gpml-env-prime\nvagrant up --no-parallel\n```\n\nIf its the first time you have started the project it will build all the relevant Docker containers, downloading any dependencies that may be missing.\n\nYou reach the web app through `http://projectname.dev` where `.dev` is a suffix of your choice. You will need to set up a wildcard for `*.dev` (for example, using DNSMASQ) or a separate HOST entry for each project you are working with.\n\nThe first part of the output from a vagrant command should show the hostname for the project you are working on.\n\nEvery project should be designed to start up in its most common configuration. However, some projects have various configuration options; check the project's README for details.  For example, your project may support solo development with a local mysql db and collaborative development with a shared office db.\n\n### Code changes \u0026 Image Rebuilds\n\nAny code changes that you make will be reflected immediately in your application; ie. changes to files within the `./projectname/code` branch. This area is shared with your Docker container in real time.\n\nIf you make changes to the environment project will require you to rebuild the Docker container.  You can rebuild the Docker image and restart the specific container, for example:\n```\n$ vagrant reload gpml-solo\n==\u003e gpml-solo: Stopping container...\n==\u003e gpml-solo: Deleting the container...\n==\u003e gpml-solo: Syncing folders to the host VM...\n    gpml-solo: Mounting shared folders...\n    gpml-solo: /var/lib/docker/docker_1445210888_51157 =\u003e /Users/modius/code/gpml-env-prime\n    gpml-solo: /var/lib/docker/docker_build_7c1f2b280e255fed5efe4885765cdf40 =\u003e /Users/modius/code/gpml-env-prime\n==\u003e gpml-solo: Building the container from a Dockerfile...\n    gpml-solo: Sending build context to Docker daemon 524.6 kB\n...snip...8\u003c...time passess...\n    gpml-solo: Successfully built 5f44b81bfc43\n    gpml-solo: Image: 5f44b81bfc43\n==\u003e gpml-solo: Warning: When using a remote Docker host, forwarded ports will NOT be\n==\u003e gpml-solo: immediately available on your machine. They will still be forwarded on\n==\u003e gpml-solo: the remote machine, however, so if you have a way to access the remote\n==\u003e gpml-solo: machine, then you should be able to access those ports there. This is\n==\u003e gpml-solo: not an error, it is only an informational message.\n==\u003e gpml-solo: Creating the container...\n    gpml-solo:   Name: 7001-gpml\n    gpml-solo:  Image: 5f44b81bfc43\n    gpml-solo: Volume: /vagrant/gpml-env-prime/code:/var/www/farcry\n    gpml-solo: Volume: /vagrant/gpml-env-prime/config/lucee/lucee-web.xml.cfm:/opt/lucee/web/lucee-web.xml.cfm\n    gpml-solo: Volume: /vagrant/gpml-env-prime/logs/lucee:/opt/lucee/web/logs\n    gpml-solo: Volume: /vagrant/gpml-env-prime/logs/nginx:/var/log/nginx\n    gpml-solo: Volume: /vagrant/gpml-env-prime/logs/supervisor:/var/log/supervisor\n    gpml-solo: Volume: /vagrant/gpml-env-prime/logs/tomcat:/usr/local/tomcat/logs\n    gpml-solo: Volume: /var/lib/docker/docker_1445210888_51157:/vagrant\n    gpml-solo:   Port: 7001:80\n    gpml-solo:   Link: mysql-gpml:mysql\n    gpml-solo:  \n    gpml-solo: Container created: f0d2bc1975702e7c\n==\u003e gpml-solo: Starting container...\n==\u003e gpml-solo: Provisioners will not be run since container doesn't support SSH.\n==\u003e gpml-solo: Removing synced folders...\n```\n\n_Note, `vagrant status` will tell you the name of all the containers the project builds. OR check the project README for specific details on your project._\n\n\n### Using secure connections\n\nThe [nginx proxy](https://github.com/jwilder/nginx-proxy) that Workbench uses supports\nenabling SSL for all connections.\n\n1. Add a `certs` directory to your workbench directory.\n2. Add `VIRTUAL_HOST.key` and `VIRTUAL_HOST.crt` files to that directory, where\n   VIRTUAL_HOST is the value set in the Vagrant docker config for the container.\n3. Alternatively, you can use a specific certificate for a container by adding\n   `\"CERT_NAME\" =\u003e \"sharedcert\"` as an environment variable on the container,\n   where `sharedcert.key` and `sharedcert.crt` are the certificates you added.\n4. In the workbench `Vagrantfile`, find the command to run `jwilder/nginx-proxy`\n   and add `-p 443:443 -v /vagrant/certs:/etc/nginx/certs` to the arguments.\n5. Reprovision workbench: `vagrant provision workbench`.\n6. Reload your containers (see above).\n\n\n## Workbench `Vagrantfile` explained\n\n```ruby\n################################################## \n# Daemonite Docker Workbench\n# v1.0\n##################################################\nWORKBENCH_IP = \"172.22.22.22\"\nVagrant.require_version \"\u003e= 1.7.4\"\n\nVagrant.configure(\"2\") do |config|\n  # configure hostmanager plugin; https://github.com/smdahlen/vagrant-hostmanager\n  config.hostmanager.enabled = true\n  config.hostmanager.manage_host = true\n  config.hostmanager.ignore_private_ip = false\n  config.hostmanager.include_offline = true\n```\n\nThe IP address (defined at `WORKBENCH_IP`) can be changed as needed.  The Vagrant `hostmanager` plugin is used to set up a simple hostname alias of *workbench*.\n\n```ruby\n# setting that appears to help provisioning on Windows\nconfig.ssh.forward_agent = true\n```\n\nSSH forwarding is normally set to false, but appears to be necessary to get the provisioning working properly on Windows.\n\n```ruby\n  ##################################################\n  # Start Docker host\n  ##################################################\n  config.vm.define \"workbench\", autostart: true do |dh|  \n    \n    # configure virtual machine\n    dh.vm.box = \"dduportal/boot2docker\"\n    dh.vm.hostname = \"workbench\"\n    dh.vm.network :private_network, ip: WORKBENCH_IP\n    dh.hostmanager.aliases = %w(workbench.dev workbench)\n    dh.vm.synced_folder \".\", \"/vagrant\", type: \"virtualbox\"\n```\n\nThe `dduportal/boot2docker` box is preferred as its more up to date than the default that comes with Vagrant.\n\nWe sync everything under the Workbench folder into the VM for convenience: `dh.vm.synced_folder \".\", \"/vagrant\", type: \"virtualbox\"`\n\n```\n    dh.vm.provider \"virtualbox\" do |vb|\n      vb.memory = 4096\n      vb.cpus = 2\n      vb.customize [\"modifyvm\", :id, \"--nictype2\", \"virtio\"]\n    end\n\n  end\n```\n\nThe **Docker Host** is designed to hold the containers of several underlying projects, hence an initial setting of 4GB RAM and 2CPUs. These settings should be adjusted to suit your environment.\n\n`vb.customize [\"modifyvm\", :id, \"--nictype2\", \"virtio\"]` is a network setting that seems to solve some problems for OSX users.  Feel free to remove or adjust to suit your environment.\n\n\n```\n  ##################################################\n  # Provision Workbench\n  ##################################################\n  # clean up containers prior to provisioning\n  config.vm.provision \"shell\", inline: \u003c\u003c-SHELL\n    # clean up containers prior to provisioning\n    docker rm --force `docker ps -qa`\n    echo \"Soaping.. Scrubbing.. Spongeing.. Docker cleaned!\"\n  SHELL\n\n  config.vm.provision \"docker\" do |d|\n    d.images = [\"tutum/mysql:5.6\", \"lucee/lucee-nginx\"]\n    # start nginx-proxy; https://github.com/jwilder/nginx-proxy\n    d.run \"jwilder/nginx-proxy\", args: \"-p 80:80 -v '/var/run/docker.sock:/tmp/docker.sock:ro'\"\n    # start dockerui; https://github.com/crosbymichael/dockerui\n    d.run \"dockerui/dockerui\", args: \"-p 81:9000 --privileged -v '/var/run/docker.sock:/var/run/docker.sock' -e VIRTUAL_HOST='workbench,workbench.dev'\"\n    # start cAdvisor; https://github.com/google/cadvisor\n    d.run \"google/cadvisor\", args: \"-v '/:/rootfs:ro' -v '/var/run:/var/run:rw' -v '/sys:/sys:ro' -v '/var/lib/docker/:/var/lib/docker:ro' -p 82:8080 --detach=true\"\n  end\n\n# /config\nend\n```\n\nThe Workbench is provisioned by:\n\n- removing all containers (running or dead)\n- importing common Docker images for development (feel free to adjust)\n- setting up an [NGINX proxy](https://github.com/jwilder/nginx-proxy) to enable the use of hostnames with containers\n- enabling [DockerUI](https://github.com/crosbymichael/dockerui) for visualising the contents of your Boot2Docker instance (saves having to SSH onto the box and do things manually)\n- running [cAdvisor](https://github.com/google/cadvisor) for monitoring the health of the virtual machines containers\n\nEnjoy.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaemonite%2Fworkbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaemonite%2Fworkbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaemonite%2Fworkbench/lists"}