{"action":"created","issue":{"url":"https://api.github.com/repos/SynoCommunity/spksrc/issues/788","labels_url":"https://api.github.com/repos/SynoCommunity/spksrc/issues/788/labels{/name}","comments_url":"https://api.github.com/repos/SynoCommunity/spksrc/issues/788/comments","events_url":"https://api.github.com/repos/SynoCommunity/spksrc/issues/788/events","html_url":"https://github.com/SynoCommunity/spksrc/issues/788","id":25142735,"number":788,"title":"Use Docker and Vagrant to create a uniform dev environment","user":{"login":"Skindred","id":2817350,"avatar_url":"https://avatars.githubusercontent.com/u/2817350?v=3","gravatar_id":"","url":"https://api.github.com/users/Skindred","html_url":"https://github.com/Skindred","followers_url":"https://api.github.com/users/Skindred/followers","following_url":"https://api.github.com/users/Skindred/following{/other_user}","gists_url":"https://api.github.com/users/Skindred/gists{/gist_id}","starred_url":"https://api.github.com/users/Skindred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Skindred/subscriptions","organizations_url":"https://api.github.com/users/Skindred/orgs","repos_url":"https://api.github.com/users/Skindred/repos","events_url":"https://api.github.com/users/Skindred/events{/privacy}","received_events_url":"https://api.github.com/users/Skindred/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2014-01-07T01:32:32Z","updated_at":"2015-03-18T16:55:23Z","closed_at":null,"body":"Using Docker ( http://www.docker.io/ ) and Vagrant ( http://www.vagrantup.com/ ),\r\na consistent easy and fast to deploy development environment is extremely easy to set up:\r\n\r\n\r\nInstall vagrant\r\n\r\n\r\nMove to a folder where you want to keep your Vagrant VM's\r\n(eg. %UserProfile%\\VirtualBox VMs)\r\n\r\nRun:\r\n\r\ngit clone https://github.com/dotcloud/docker.git\r\ncd docker\r\nvagrant up && vagrant down && vagrant up\r\n\r\nThe VM should now be live in VirtualBox.\r\nConnect to the VM using vagrant:vagrant on localhost:2222 and run (be sure to replace all instances of Skindred/spksrc with <YourUsername>/spksrc:\r\n\r\ndocker build -t Skindred/spksrc https://raw.github.com/Skindred/docker-spksrc/master/Dockerfile\r\n\r\nThis will:\r\n\r\n- pull in Debian 7.3\r\n- download / install all needed packages into the Docker image\r\n- git checkout spksrc to /spksrc\r\n- perform make setup\r\n\r\n\r\nShould this fail, (it happened to me twice since apt-get gave me broken pipes while downloading packages), you can run:\r\n\r\ndocker stop $(docker ps -q)\r\ndocker rm $(docker ps -a -q)\r\ndocker rmi $(docker images -a -q)\r\n\r\n\r\nIf the image has been successfully built, cleanup all containers:\r\n\r\ndocker rm $(docker ps -a -q)\r\n\r\n\r\nYou can now use the image by spawning a new container from it:\r\n\r\ndocker run -i -t Skindred/spksrc /bin/bash\r\ncd /spksrc/toolchains/; for i in *; do cd $i; make; cd ..; done; rm -f /spksrc/distrib/gcc*.tgz #install all toolchains, you can ofcourse also choose to install only one\r\n\r\n\r\nOnce you exit out of this container, the instance can be found using:\r\n\r\ndocker ps -a\r\n\r\n\r\nYou must then commit that container using:\r\n\r\ndocker commit <id> Skindred/spksrc:<tag>\r\n\r\n\r\n\r\n\r\nIf you have an issue compiling one piece of software, that depends on another piece, and you want to try out different versions, you can just:\r\n\r\nVersion A:\r\n\r\n- docker run -i -t Skindred/spksrc[:<tag>] /bin/bash\r\n- make version a\r\n- exit\r\n- docker ps -a\r\n- docker commit <id> Skindred/spksrc:python-libtorrent\r\n- docker run -i -t Skindred/spksrc:python-libtorrent /bin/bash\r\n- do whatever you want to test\r\n\r\n\r\nVersion B:\r\n\r\n- docker run -i -t Skindred/spksrc[:<tag>] /bin/bash\r\n- make version b\r\n- exit\r\n- docker ps -a\r\n- docker commit <id> Skindred/spksrc:python-libtorrent-rakshasa\r\n- docker run -i -t Skindred/spksrc:python-libtorrent-rakshasa /bin/bash\r\n- do whatever you want to test\r\n\r\n\r\nThe Dockerfile is based off of https://github.com/bydavy/docker-spksrc, which I found after I had created my own Dockerfile.\r\nThe Dockerfile by bydavy was better than mine, but will no longer be needed once I have a working 32 bit base."},"comment":{"url":"https://api.github.com/repos/SynoCommunity/spksrc/issues/comments/83056357","html_url":"https://github.com/SynoCommunity/spksrc/issues/788#issuecomment-83056357","issue_url":"https://api.github.com/repos/SynoCommunity/spksrc/issues/788","id":83056357,"user":{"login":"Diaoul","id":319220,"avatar_url":"https://avatars.githubusercontent.com/u/319220?v=3","gravatar_id":"","url":"https://api.github.com/users/Diaoul","html_url":"https://github.com/Diaoul","followers_url":"https://api.github.com/users/Diaoul/followers","following_url":"https://api.github.com/users/Diaoul/following{/other_user}","gists_url":"https://api.github.com/users/Diaoul/gists{/gist_id}","starred_url":"https://api.github.com/users/Diaoul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Diaoul/subscriptions","organizations_url":"https://api.github.com/users/Diaoul/orgs","repos_url":"https://api.github.com/users/Diaoul/repos","events_url":"https://api.github.com/users/Diaoul/events{/privacy}","received_events_url":"https://api.github.com/users/Diaoul/received_events","type":"User","site_admin":false},"created_at":"2015-03-18T16:55:23Z","updated_at":"2015-03-18T16:55:23Z","body":"@bru7us: parallelisation is done by Make inside the container, looking at my CPU usage on the host it is clear to me that more than one core is used. I don't know if that's optimal but it seems to use all my CPU just fine."}}