gitlab-org--gitlab-foss/doc/install/digitaloceandocker.md
Achilleas Pipinellis 5a4bab0853
Clean up docs under install/
This is an initiative to ensure all documentation complies completely
with the Documentation Style Guide section "Documentation is the single
source of truth (SSOT)" according to this epic
https://gitlab.com/groups/gitlab-org/-/epics/1280.

In particular, the changes of this commit touch all files under
doc/install/. Most notably:

- install/redis.md:
        Redirect to Redis section of install guide.

- install/pivotal/index.md:
        Changed its content to reflect the current status, which is no
        longer supported (since 2017!).

- install/google-protobuf.md:
        Incorporated inside installation.md under the troubleshooting section.

- install/openshift_and_gitlab.md:
        Clarified that this guide is no longer relevant. We might want to
        redirect to the Chart docs in the future.

- install/structure.md:
        Incorporated inside installation.md under its own section.

- install/kubernetes/index.md:
        Redirected to https://docs.gitlab.com/charts
2019-06-03 20:13:53 +02:00

3.7 KiB

type
howto

Digital Ocean and Docker Machine test environment

This guide is for quickly testing different versions of GitLab and not recommended for ease of future upgrades or keeping the data you create.

Initial setup

In this guide you'll configure a Digital Ocean droplet and set up Docker locally on either macOS or Linux.

On macOS

Install Docker Toolbox

On Linux

Install Docker Engine

Install Docker Machine

NOTE: Note: The rest of the steps are identical for macOS and Linux.

Create new docker host

  1. Login to Digital Ocean.

  2. Generate a new API token at https://cloud.digitalocean.com/settings/api/tokens.

    This command will create a new DO droplet called gitlab-test-env-do that will act as a docker host.

    NOTE: Note: 4GB is the minimum requirement for a Docker host that will run more than one GitLab instance.

    • RAM: 4GB
    • Name: gitlab-test-env-do
    • Driver: digitalocean
  3. Set the DO token:

    export DOTOKEN=<your generated token>
    
  4. Create the machine:

    docker-machine create \
      --driver digitalocean \
      --digitalocean-access-token=$DOTOKEN \
      --digitalocean-size "4gb" \
        gitlab-test-env-do
    

Resource: https://docs.docker.com/machine/drivers/digital-ocean/.

Creating GitLab test instance

Connect your shell to the new machine

In this example we'll create a GitLab EE 8.10.8 instance.

First connect the docker client to the docker host you created previously.

eval "$(docker-machine env gitlab-test-env-do)"

You can add this to your ~/.bash_profile file to ensure the docker client uses the gitlab-test-env-do docker host

Create new GitLab container

  • HTTP port: 8888
  • SSH port: 2222
    • Set gitlab_shell_ssh_port using --env GITLAB_OMNIBUS_CONFIG
  • Hostname: IP of docker host
  • Container name: gitlab-test-8.10
  • GitLab version: EE 8.10.8-ee.0

Set up container settings

export SSH_PORT=2222
export HTTP_PORT=8888
export VERSION=8.10.8-ee.0
export NAME=gitlab-test-8.10

Create container

docker run --detach \
--env GITLAB_OMNIBUS_CONFIG="external_url 'http://$(docker-machine ip gitlab-test-env-do):$HTTP_PORT'; gitlab_rails['gitlab_shell_ssh_port'] = $SSH_PORT;" \
--hostname $(docker-machine ip gitlab-test-env-do) \
-p $HTTP_PORT:$HTTP_PORT -p $SSH_PORT:22 \
--name $NAME \
gitlab/gitlab-ee:$VERSION

Connect to the GitLab container

Retrieve the docker host IP

docker-machine ip gitlab-test-env-do
# example output: 192.168.151.134

Browse to: http://192.168.151.134:8888/.

Execute interactive shell/edit configuration

docker exec -it $NAME /bin/bash
# example commands
root@192:/# vi /etc/gitlab/gitlab.rb
root@192:/# gitlab-ctl reconfigure

Resources