How to Change root User’s of a Running Gitlab Repository from a Docker Container in Microsoft Windows

Posted on

How to Change root User’s of a Running Gitlab Repository from a Docker Container in Microsoft Windows

This is an article where the main purpose is to be able to change the password of a user account of Gitlab repository. Primarily, user with ‘root’ account. The process for changing the ‘root’ password has several reasons behind it. One possible reason among them is actually forgetting the password. So, in order to be able to login to the Gitlab repository using ‘root’ account is just by changing the password itself. This article is going to focus on how to change it. Actually, it has a certain connection with the previous article. Especially when the process for changing the root password generated a certain error. One of that error is changing the password which ended in failure. The reason is that the password given is containg common used combinations of words and letters. That previous article exist in ‘How to Solve Error Message Password must not contain commonly used combinations of words and letters when changing root user’s password of Gitlab Docker Container

Table of Contents

Introduction

Actually, it started where there is a requirement to access a Gitlab repository. In this case, it run from a Docker container exist in a device running using Microsoft Windows operating system. Below are the sequences for doing it  :

  1. First of all, just check the existing running Docker container where the Gitlab repository exist and receiving requests :

    C:\Users\Personal>docker ps --all | findstr gitlab
    0617572fd1d7 gitlab/gitlab-ee:latest "/assets/wrapper" 9 months ago Up 6 hours (healthy) 0.0.0.0:22->22/tcp, 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp gitlab
    C:\Users\Personal>
    
  2. After finding the Docker container and make sure it is running, just access it through any available web browser. As for the example in this case, the Gitlab repository is available in the URL address of ‘localhost’ with the port of 80 as follows :

    How to Change root User's of a Running Gitlab Repository from a Docker Container in Microsoft Windows
    How to Change root User’s of a Running Gitlab Repository from a Docker Container in Microsoft Windows
  3. Continuing the previous step,  because of forgetting the password of the root account when accessing the Gitlab repository, the following image depicting it will appear :

    How to Change root User's of a Running Gitlab Repository from a Docker Container in Microsoft Windows
    How to Change root User’s of a Running Gitlab Repository from a Docker Container in Microsoft Windows
  4. Actually, the password is wrong because of either the typing mistake or the forgotten password which also lead to a false input. In the end, there is a need to change the password of the root account.

How to Change root User’s Password of a Running Gitlab Repository from a Docker Container in Microsoft Windows

For the steps on changing root user’s password, actually it exist in this link. So, using that article exist in the link, in order to change the password of the root user, just execute the following steps :

  1. Start by accessing the command line interface or the bash shell of the Docker container by executing the following command in the Command Prompt :

    C:\Users\Personal>docker exec -it 0617572fd1d7 /bin/bash
    root@gitlab:/#
  2. As soon it display the command line prompt of the operating system host, just execute the following command to change or reset the password of the root account below :

    C:\Users\Personal>docker exec -it 0617572fd1d7 bash
    root@gitlab:/# 
    root@gitlab:/# gitlab-rake "gitlab:password:reset[root]"
    Enter password:
    Confirm password:
    Password successfully updated for user with username root.
    root@gitlab:/#

Test by trying to log in to the Gitlab Repository

Finally, in order to test whether the login process is a success after changing the password, just get into the Gitlab repository using ‘root’ account. The following is the appearance of it :

How to Change root User's of a Running Gitlab Repository from a Docker Container in Microsoft Windows
How to Change root User’s of a Running Gitlab Repository from a Docker Container in Microsoft Windows

If the login process using the root account is a success, the following appearance of the main display of the Gitlab repository will be present :

How to Change root User's of a Running Gitlab Repository from a Docker Container in Microsoft Windows
How to Change root User’s of a Running Gitlab Repository from a Docker Container in Microsoft Windows

Leave a Reply