Both GitLab CE and EE are in Docker Hub:

GitLab CE Docker image
GitLab EE Docker image

The GitLab Docker images are monolithic images of GitLab running all the necessary services on a single container.

Prerequisites

Docker installation is required, see the official installation docs
Docker Compose is required, see the Install Docker Compose

Installation

docker-compose.yml文件内容:

web:
  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
      # Add any other gitlab.rb configuration here, each on its own line
  ports:
    - '80:80'
    - '443:443'
    - '22:22'
  volumes:
    - './runtime/gitlab/etc/gitlab:/etc/gitlab'
    - './runtime/var/log/gitlab:/var/log/gitlab'
    - './runtime/var/opt/gitlab:/var/opt/gitlab'

then run docker-compose up

last visit http://gitlab.example.com

Reference

GitLab Docker images – GitLab Documentation
https://docs.gitlab.com/omnibus/docker/README.html

打赏

Leave a Reply

Your email address will not be published. Required fields are marked *