[참고] (설치) GitLab-CE on Virtualbox (Virtualbox, Vagrant)

[참고] (설치) GitLab-CE on Virtualbox (Virtualbox, Vagrant)

2022-10-05 last update

5 minutes reading VirtualBox GitLab Vagrant


개요


  • GitLab-CE를 Vagrant를 사용하여 Virtualbox에 설치.

  • 환경


  • 호스트
  • Windows 10 64bit
  • VirtualBox 5.1.14
  • Vagrant 1.9.1


  • 절차



    그 1



    htps // 아보 t. 기 t b. 코 m/인 s 타치온/ 의 Vagrant option by Tuomo Tanskanen
    ...어쩐지, 잘 되지 않았어... gitlab.rb 를 잘 편집해야 한다?

  • 힘껏 가자.

    셸에서.
    git clone https://github.com/tuminoid/gitlab-installer.git
    cd gitlab-installer
    cp gitlab.rb.example gitlab.rb
    # gitlab.rbを適当に編集するといい。(が、手をつけず..
    vagrant up
    

  • http://localhost:8443/ 에 브라우저로 액세스 ... ..

  • 그 2



    htps // 아보 t. 기 t b. 코 m / 드 w ぉ ds / # 우분 1604 에 따른 Vagrantfile 작성

  • 적절한 폴더에 Vagrantfile
    Vagrantfile
    # Vagrantfile
    # :: mt08
    
    VB_NAME="GitLab-CE"
    #
    VM_MEMORY=2048
    VM_CORES=2
    VM_HOSTNAME="gitlab1.localdomain"
    #VM_BASE_BOX="ubuntu/xenial64"
    VM_BASE_BOX="bento/ubuntu-16.04"
    
    Vagrant.configure("2") do |config|
        config.vm.box = VM_BASE_BOX
        config.vm.network "forwarded_port", guest: 80, host: 8888
        #config.vm.network "public_network", bridge: 'Intel(R) Ethernet Connection I217-LM'
        config.vm.hostname = VM_HOSTNAME
    
        config.vm.provider "virtualbox" do |vb|
            #   vb.gui = true
            vb.name = VB_NAME
            vb.memory = VM_MEMORY
            vb.cpus = VM_CORES
        end
    
        config.vm.provision "shell", inline: <<-SHELL
            #echo 'Acquire::http::Proxy "http://apt-cache-server:3142";' | tee /etc/apt/apt.conf.d/02proxy
            #
            apt-get -q update -q
            DEBIAN_FRONTEND=noninteractive apt-get -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
            DEBIAN_FRONTEND=noninteractive apt-get -q install -q -y curl openssh-server ca-certificates postfix
            [ -f /etc/apt/apt.conf.d/02proxy ] && rm -fv /etc/apt/apt.conf.d/02proxy
            #
            curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | bash
            # Installing GitLab Community Edition
            apt-get -q install -q -y gitlab-ce
            #
            gitlab-ctl reconfigure
        SHELL
    end
    
    

  • vagrant up 기다린다
  • 설치가 끝나면 호스트 브라우저를 열고 http://localhost:8888/로 이동합니다. 처음에는 루트 비밀번호 설정 화면이 나옵니다.

  • 기타


  • VM_BASE_BOX 에서 ubuntu 공식 또는 bento 님을 선택
  • 호스트 8888번 포트를 게스트 80번(http)에 포트 포워드 하고 있다.
  • public_network를 설정하면 다른 PC에서도 액세스 할 수 있습니다
  • 하지만 https 가 아니야
  • apt-cache 서버가 있으면, 설정하면 재시도가 많을 때는 좋을지도.
  • Gitlab 패키지는 오류가 발생하기 때문에 설치 전에 캐시 설정을 지 웁니다. /vagrant
  • postfix의 설정은, No Configuration 가 되어 있으므로, 나중에 한다면, sudo dpkg-reconfigure postfix 로.