Upgrade to Pro — share decks privately, control downloads, hide ads and more …

いまからDockerで始めるGitLab CE/gitlabjp-20170919

Avatar for Kunihiro Morita Kunihiro Morita
September 19, 2017

いまからDockerで始めるGitLab CE/gitlabjp-20170919

GitLab Meetup Fukuoka #1 の資料です。
https://gitlab-jp.connpass.com/event/64349/

Avatar for Kunihiro Morita

Kunihiro Morita

September 19, 2017
Tweet

More Decks by Kunihiro Morita

Other Decks in Technology

Transcript

  1. About GitLab GitLab unifies issues, code review, CI and CD

    into a single UI — https://about.gitlab.com 2017/9/19 GitLab Meetup Fukuoka #1 3
  2. GitLab CE/EE1 ηϧϑϗεςΟϯά » Community Edition (CE) <- ࠓ೔͸͜ͷ࿩ »

    Enterprise Edition (EE) » Starter (EES) » Premium (EEP) 1 https://about.gitlab.com/products/ 2017/9/19 GitLab Meetup Fukuoka #1 5
  3. GitLab.com2 SaaS » Free (EES૬౰) » Bronze » Silver »

    Gold 2 https://about.gitlab.com/gitlab-com/ 2017/9/19 GitLab Meetup Fukuoka #1 6
  4. GitLab CE Features1 » Built-in CI/CD » Cycle Analytics »

    Issue Boards » Time tracking » Preview your changes with Review Apps » Publish static websites for free with GitLab Pages 1 https://about.gitlab.com/products/ 2017/9/19 GitLab Meetup Fukuoka #1 14
  5. Install Methods » apt / yum » Docker <- ࠓ೔͸͜ͷ࿩

    » Azure VM / AWS AMI / GCP VM » ͘͞ΒͷVPSʮελʔτΞοϓεΫϦϓτʯ<- NEW4 » Ansible Playbook » ͳͲͳͲ 4 https://vps-news.sakura.ad.jp/2017/08/29/startup-gitlab/ 2017/9/19 GitLab Meetup Fukuoka #1 16
  6. Omnibus package installation » ਪ঑ » GitLabશ෦ » ඞཁΞϓϦέʔγϣϯ(Ruby, Nginx,

    PostgreSQLͳͲ)ಉࠝ 2017/9/19 GitLab Meetup Fukuoka #1 17
  7. Docker Image5 » Offical » GitLab CE » GitLab EE

    » GitLab Runner » based on the Omnibus package 5 https://docs.gitlab.com/ce/install/docker.html 2017/9/19 GitLab Meetup Fukuoka #1 18
  8. docker run -d \ -h gitlab.example.com \ -p 80:80 -p

    443:443 \ --name gitlab \ --restart always \ -v $PWD/gl_env/etc/gitlab/:/etc/gitlab \ -v $PWD/gl_env/var/log/gitlab:/var/log/gitlab \ -v $PWD/gl_env/var/opt/gitlab:/var/opt/gitlab \ gitlab/gitlab-ce:latest 2017/9/19 GitLab Meetup Fukuoka #1 20
  9. ઃఆ มߋ docker exec -it gitlab vim /etc/gitlab/gitlab.rb ൓ө docker

    restart gitlab 2017/9/19 GitLab Meetup Fukuoka #1 21
  10. version: '2' services: gitlab: image: "gitlab/gitlab-ce:latest" restart: always hostname: "gitlab.example.com"

    environment: GITLAB_OMNIBUS_CONFIG: | external_url 'http://gitlab.example.com' gitlab_rails['gitlab_shell_ssh_port'] = 22 ports: - "80:80" - "22:22" volumes: - "./gl_env/etc/gitlab:/etc/gitlab" - "./gl_env/var/log/gitlab:/var/log/gitlab" - "./gl_env/var/opt/gitlab:/var/opt/gitlab" 2017/9/19 GitLab Meetup Fukuoka #1 23
  11. ϙʔτมߋ6 HTTP(S) external_url 'http://gitlab.example.com:8080' external_url 'https://gitlab.example.com:8443' SSH gitlab_rails['gitlab_shell_ssh_port'] = 2224

    6 https://docs.gitlab.com/omnibus/docker/README.html#install-gitlab-using-docker-compose 2017/9/19 GitLab Meetup Fukuoka #1 25
  12. version: '2' services: gitlab: image: "gitlab/gitlab-ce:latest" restart: always hostname: "gitlab.example.com"

    environment: GITLAB_OMNIBUS_CONFIG: | external_url 'https://gitlab.example.com:8443' gitlab_rails['gitlab_shell_ssh_port'] = 2224 ports: - "8443:8443" - "2224:22" volumes: - "./gl_env/etc/gitlab:/etc/gitlab" - "./gl_env/var/log/gitlab:/var/log/gitlab" - "./gl_env/var/opt/gitlab:/var/opt/gitlab" 2017/9/19 GitLab Meetup Fukuoka #1 26
  13. version: '2' services: gitlab: ʙলུʙ runner: image: gitlab/gitlab-runner:latest restart: always

    volumes: - "/var/run/docker.sock:/var/run/docker.sock" - "./gl_env/etc/gitlab-runner:/etc/gitlab-runner" 2017/9/19 GitLab Meetup Fukuoka #1 29
  14. ͋ͱ͸ɺ͜ΕΛ͜͏ͯ͠… » Container Registory7 » SMTP (SendGrid)8 » OAuth (AzureAD)9

    9 https://docs.gitlab.com/ce/integration/azure.html 8 https://docs.gitlab.com/omnibus/settings/smtp.html 7 https://docs.gitlab.com/ce/administration/container_registry.html#configure-container-registry-under-an- existing-gitlab-domain 2017/9/19 GitLab Meetup Fukuoka #1 31
  15. ·ͱΊ » ߏங͸apt / yum, DockerͰ؆୯ » Ξοϓσʔτ͸Dockerӡ༻ͷํָ͕ » ηϧϑϗεςΟϯά͸GitLab-CE/EE

    » ϗεςΟϯάෆཁͳΒSaaSͷGitLab.comָ͕ » 1ͭͷUIͰIssusɺίʔυϨϏϡʔɺContainer Registory, CI/CDΛ ؅ཧͰ͖ΔͷͰָ 2017/9/19 GitLab Meetup Fukuoka #1 35