Create GitLab Environment For Testing.

Photo by John O’Nolan on Unsplash

Introduction

I want to prepare a minimal, reconstructable and disposable GitLab environment for checking operation and data migration. It does not foresee that it will be used by other users in actual work.

Setup

In official documentation there is description how setup GitLab on Docker

It not will be a production operation, it is just a local verification test and data migration, so http://localhost:8081. I think that Docker Desktop for is often used in the verification environment, docker-compose.yml. In this case, docker-compose can be used from the beginning, so it is easier than specifying options .

docker-compose.yaml

  • Create directory
root@vagrant:/home/vagrant# mkdir -p /opt/gitlab
  • Specify the path of the volume to be persisted
root@vagrant:/home/vagrant# export GITLAB_HOME=/opt/gitlab
  • Run docker compose
root@vagrant:/home/vagrant# docker-compose up -d

After that, wait for a while, check the startup in the log, access with a browser and change the administrator password. We can find this in easy way.

root@vagrant:/home/vagrant# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
35024e1396aa gitlab/gitlab-ce:latest "/assets/wrapper" 10 minutes ago Up 10 minutes (healthy) 22/tcp, 80/tcp, 443/tcp, 0.0.0.0:8080->8081/tcp, :::8080->8081/tcp vagrant_web_1
root@vagrant:/home/vagrant# docker exec -it vagrant_web_1 grep 'Password:' /etc/gitlab/initial_root_password

Now we can open URL http://HOST-IP:8080/ and change password, default login is root.

 by the author.

--

--

--

DevOps Consultant. I’m strongly focused on automation, security, and reliability.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Avoid Going Insane As A Writer And have sharp-looking shirts while you’re at it……..

LinkedOut — Automate LinkedIn

SQL: THE HACKERRANK CHALLENGE

3.6 Mind-Sets for Successful Adoption of TDD

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Maciej

Maciej

DevOps Consultant. I’m strongly focused on automation, security, and reliability.

More from Medium

Adding Windows Node to K8S Cluster and Monitoring

Just Ansible It

Connecting the Dots with Terraform(IaC)!!

Creating, Adding, Authorizing Users And Groups With Ansible