Commit 7c021058 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'docs/fix-digital-ocean-docker' into 'master'

Improve markdown and fix links that don't render correctly

See merge request gitlab-org/gitlab-ce!22737
parents b1a03274 28c825be
# Digital Ocean and Docker Machine test environment # Digital Ocean and Docker Machine test environment
## Warning. This guide is for quickly testing different versions of GitLab and CAUTION: **Caution:**
## not recommended for ease of future upgrades or keeping the data you create. 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 ## Initial setup
...@@ -12,84 +13,79 @@ locally on either macOS or Linux. ...@@ -12,84 +13,79 @@ locally on either macOS or Linux.
#### Install Docker Toolbox #### Install Docker Toolbox
1. [https://www.docker.com/products/docker-toolbox](https://www.docker.com/products/docker-toolbox) - <https://www.docker.com/products/docker-toolbox>
### On Linux ### On Linux
#### Install Docker Engine #### Install Docker Engine
1. [https://docs.docker.com/engine/installation/linux](https://docs.docker.com/engine/installation/linux/) - <https://docs.docker.com/engine/installation/linux/>
#### Install Docker Machine #### Install Docker Machine
1. [https://docs.docker.com/machine/install-machine](https://docs.docker.com/machine/install-machine/) - <https://docs.docker.com/machine/install-machine/>
_The rest of the steps are identical for macOS and Linux_ NOTE: **Note:**
The rest of the steps are identical for macOS and Linux.
### Create new docker host ### Create new docker host
1. Login to Digital Ocean 1. Login to Digital Ocean.
1. Generate a new API token at https://cloud.digitalocean.com/settings/api/tokens 1. 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.
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.
**Note: 4GB is the minimum requirement for a Docker host that will run more then one GitLab instance** - RAM: 4GB
- Name: `gitlab-test-env-do`
- Driver: `digitalocean`
+ RAM: 4GB 1. Set the DO token:
+ Name: `gitlab-test-env-do`
+ Driver: `digitalocean`
```sh
export DOTOKEN=<your generated token>
```
**Set the DO token** - Replace the string below with your generated token 1. Create the machine:
``` ```sh
export DOTOKEN=cf3dfd0662933203005c4a73396214b7879d70aabc6352573fe178d340a80248 docker-machine create \
```
**Create the machine**
```
docker-machine create \
--driver digitalocean \ --driver digitalocean \
--digitalocean-access-token=$DOTOKEN \ --digitalocean-access-token=$DOTOKEN \
--digitalocean-size "4gb" \ --digitalocean-size "4gb" \
gitlab-test-env-do gitlab-test-env-do
``` ```
+ Resource: https://docs.docker.com/machine/drivers/digital-ocean/
Resource: <https://docs.docker.com/machine/drivers/digital-ocean/>.
### Creating GitLab test instance ### Creating GitLab test instance
#### Connect your shell to the new machine #### Connect your shell to the new machine
In this example we'll create a GitLab EE 8.10.8 instance. 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. First connect the docker client to the docker host you created previously.
``` ```sh
eval "$(docker-machine env gitlab-test-env-do)" 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 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 #### Create new GitLab container
+ HTTP port: `8888` - HTTP port: `8888`
+ SSH port: `2222` - SSH port: `2222`
+ Set `gitlab_shell_ssh_port` using `--env GITLAB_OMNIBUS_CONFIG ` - Set `gitlab_shell_ssh_port` using `--env GITLAB_OMNIBUS_CONFIG`
+ Hostname: IP of docker host - Hostname: IP of docker host
+ Container name: `gitlab-test-8.10` - Container name: `gitlab-test-8.10`
+ GitLab version: **EE** `8.10.8-ee.0` - GitLab version: **EE** `8.10.8-ee.0`
##### Set up container settings ##### Set up container settings
``` ```sh
export SSH_PORT=2222 export SSH_PORT=2222
export HTTP_PORT=8888 export HTTP_PORT=8888
export VERSION=8.10.8-ee.0 export VERSION=8.10.8-ee.0
...@@ -97,7 +93,8 @@ export NAME=gitlab-test-8.10 ...@@ -97,7 +93,8 @@ export NAME=gitlab-test-8.10
``` ```
##### Create container ##### Create container
```
```sh
docker run --detach \ 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;" \ --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) \ --hostname $(docker-machine ip gitlab-test-env-do) \
...@@ -110,23 +107,20 @@ gitlab/gitlab-ee:$VERSION ...@@ -110,23 +107,20 @@ gitlab/gitlab-ee:$VERSION
##### Retrieve the docker host IP ##### Retrieve the docker host IP
``` ```sh
docker-machine ip gitlab-test-env-do docker-machine ip gitlab-test-env-do
# example output: 192.168.151.134 # example output: 192.168.151.134
``` ```
Browse to: <http://192.168.151.134:8888/>.
+ Browse to: http://192.168.151.134:8888/
##### Execute interactive shell/edit configuration ##### Execute interactive shell/edit configuration
```sh
```
docker exec -it $NAME /bin/bash docker exec -it $NAME /bin/bash
``` ```
``` ```sh
# example commands # example commands
root@192:/# vi /etc/gitlab/gitlab.rb root@192:/# vi /etc/gitlab/gitlab.rb
root@192:/# gitlab-ctl reconfigure root@192:/# gitlab-ctl reconfigure
...@@ -134,6 +128,6 @@ root@192:/# gitlab-ctl reconfigure ...@@ -134,6 +128,6 @@ root@192:/# gitlab-ctl reconfigure
#### Resources #### Resources
+ [https://docs.gitlab.com/omnibus/docker/](https://docs.gitlab.com/omnibus/docker/) - <https://docs.gitlab.com/omnibus/docker/>.
+ [https://docs.docker.com/machine/get-started/](https://docs.docker.com/machine/get-started/) - <https://docs.docker.com/machine/get-started/>.
+ [https://docs.docker.com/machine/reference/ip/](https://docs.docker.com/machine/reference/ip/)+ - <https://docs.docker.com/machine/reference/ip/>.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment