123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <!DOCTYPE html>
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Host Your Own GitHub Alternative with GitLab Docker Container</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta charset="UTF-8">
- <meta name="keywords" content="Source Control,Docker Made Easy,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Browser Based,Web Based,Web Based Tools,Git,GitHub Alternatives,GitLab,How To Install GitLab,Linux,Self-hosted GitHub Alternative,Container,Containerization,Docker,Docker How To,Docker Installation Tutorial,Docker Simplified,Docker Tutorial,Getting Started With Docker,Ubuntu,How To,Tutorial,i12bretro">
- <meta name="author" content="i12bretro">
- <meta name="description" content="Host Your Own GitHub Alternative with GitLab Docker Container">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="revised" content="04/15/2023 06:41:56 AM" />
- <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <script type="text/javascript" src="includes/js/steps.js"></script>
- <link href="css/steps.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="gridContainer">
- <div class="topMargin"></div>
- <div id="listName" class="topMargin">
- <h1>Host Your Own GitHub Alternative with GitLab Docker Container</h1>
- </div>
- <div></div>
- <div id="content">
- <h2>What is GitLab</h2>
- <blockquote><em>GitLab is an open source end-to-end software development platform with built-in version control, issue tracking, code review, CI/CD, and more. Self-host GitLab on your own servers, in a container, or on a cloud provider. -<a href="https://gitlab.com/gitlab-org/gitlab" target="_blank">https://gitlab.com/gitlab-org/gitlab</a></em></blockquote>
- <h2>Installing Docker</h2>
- <ol>
- <li>Log into the Linux based device</li>
- <li>Run the following commands in the terminal
- <div class="codeBlock"># install prerequisites<br />
- sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y<br />
- # add docker gpg key<br />
- curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -<br />
- # add docker software repository<br />
- sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"<br />
- # install docker<br />
- sudo apt install docker-ce docker-compose containerd.io -y<br />
- # enable and start docker service<br />
- sudo systemctl enable docker && sudo systemctl start docker<br />
- # add the current user to the docker group<br />
- sudo usermod -aG docker $USER<br />
- # reauthenticate for the new group membership to take effect<br />
- su - $USER</div>
- </li>
- </ol>
- <h2>Running GitLab</h2>
- <ol>
- <li>Now that Docker is installed, run the following commands to setup the GitLab Docker container and run it
- <div class="codeBlock"># create working directory<br />
- sudo mkdir /home/$USER/docker/gitlab -p<br />
- # run the GitLab docker container<br />
- docker run --name gitlab -d --hostname DNSofHost -p 8000:80 -v /home/$USER/docker/gitlab/config:/etc/gitlab -v /home/$USER/docker/gitlab/logs:/var/log/gitlab -v /home/$USER/docker/gitlab/data:/var/opt/gitlab --restart=unless-stopped gitlab/gitlab-ce:latest<br />
- # output root user password<br />
- docker exec -it gitlab cat /etc/gitlab/initial_root_password</div>
- </li>
- <li>Copy the password to your clipboard</li>
- <li>Open a web browser and navigate to http://DNSorIP:8000</li>
- <li>Login with the username root and the password copied earlier</li>
- <li>Welcome to GitLab running in a Docker container</li>
- </ol>
- <p>Documentation: <a href="https://hub.docker.com/r/gitlab/gitlab-ce/" target="_blank">https://hub.docker.com/r/gitlab/gitlab-ce/</a></p> </div>
- </div>
- </body>
- </html>
-
|