1

I am looking to set my development machine (one physical machine) to provide me a way to manage my need of running .NET and PHP development. This is fairly easy, but problem arise when I need Apache along with IIS, and for version control I love gitlab ce which doesn't work on windows. So, my main machine is win10, and I use a separate linux box to run my gitlab and apache.

But now that machine is burned up and I am looking a way to run all that in one machine as I don't want to invest in separate machine. I am trying to study Docker as it seems solution to my problem (nor really sure). So, I install Docker with Hyper-Von my Win 10, and was able to run CentOS in docker container and install Apache and GitLab over that CentOs

But as soon as exit the centos all is gone. I understand that I need to save the machine state or docker client's state but I didn't find a way to do it or they are fairly complex to understand for me. I Also didn't find a way that when I boot up my development machine how can I make it to start that CentOS machine and that it become available on network. I am searching in docker document and various blog forum.

My question here is: As I do not understand docker quite well right now, is my thinking to use it above scenario good? Is there any better method that this? If you can assist in my problem is good for me, but if not just guide me if I am going right way.

Oh I am not concern on hardware as my machine does support my requirement for now.

Sumit Gupta
  • 2,152
  • 4
  • 29
  • 46

1 Answers1

1

You can see an example of running GitLab in a docker container in "Run GitLab on a USB Stick with Docker"

It uses an USB stick but you could use a folder on your (Windows) host.

The docker-compose.yml is

gitlab:  
 container_name: gitlab
 image: gitlab/gitlab-ce:8.5.3-ce.0
 hostname: gitlab
 environment:
   GITLAB_OMNIBUS_CONFIG: |
     external_url 'http://127.0.0.1:8050'
     gitlab_rails['gitlab_shell_ssh_port'] = 522
 ports:
  - "8050:8050"
  - "522:22"
 volumes:
  - /media/elton/usb-gitlab/gitlab/config:/etc/gitlab
  - /media/elton/usb-gitlab/gitlab/logs:/var/log/gitlab
  - /media/elton/usb-gitlab/gitlab/data:/var/opt/gitlab
 privileged: true

You might not need privileged: true as you don't need to access the USB key.
And replace /media/elton/usb-gitlab/gitlab by a Windows path (starting with /c/Users as /c/Users/yourLogin/path/to/gitlab, as only that folder is auto-mounted in the boot2docker VM)

Then:

cd /c/Users/yourLogin/path/to/gitlab  
docker-compose up -d  

In your repo, you would add:

git remote add origin ssh://git@127.0.0.1:522/<project>/<yourRepo>.git  

And you would go to http://127.0.0.1:8050/ in order to see the GitLab web interface.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks that was easy, now I only need to test and see if it remain persistent and how can I make my docker stay on with bootup. – Sumit Gupta Mar 09 '16 at 05:54
  • @SumitGupta you just have to start your docker-machine when starting to work in a new Windows session: docker-machine start. – VonC Mar 09 '16 at 05:55
  • Hyper-V start my default Docker machine on windows boot up, I am guessing gitlab will start with it right ? cannot reboot right now as some long processing is on. :) but will soon try it myself. – Sumit Gupta Mar 09 '16 at 06:12
  • thanks, seems that works, and on reboot it was there working. though it didn't pick the path as I define `/d/gitlab` or shall I define `d:/gitlab` because that is how windows use path in general? and for that how I stop running git? – Sumit Gupta Mar 09 '16 at 11:53
  • @SumitGupta boot2docker (the Linux VM which enables you to use docker) only knows about `/c/Users`. You would need to mount `/d/gitab` both on the VirtualBox and in boot2docker: http://stackoverflow.com/questions/35495639/docker-compose-mount-window-folder/35498478#35498478 – VonC Mar 09 '16 at 11:56
  • Thanks again, but I am using HyperV which doesn't have shared folder. only network folder are there I can try that though to mount on Boot2Docker. might work – Sumit Gupta Mar 09 '16 at 12:08
  • @SumitGupta yes, forget the part about virtualBox: you would still need to mount that path in boot2docker. – VonC Mar 09 '16 at 12:10