Good evening Even though I have a lot of things I want to do and study It's around this time that I haven't had enough time to think about the birth of Nico and Mahjong Soul.
My workplace, which has only used svn, is about to use git. Since I came out, I will build gitlab at home after studying.
First, create an environment to build gitlab. This time I would like to make ubuntu 18.04 on esxi.
Selection of creation type This time select a new virtual machine.
Name and guest OS selection
Storage selection
Customize settings I made the settings like this. There is nothing special, but what you should be careful about is that you do not forget to set the ISO file on the CD / DVD media. If you do not do this, you will not be able to install ubuntu.
Done Press Finish to create the image.
Start up First, start it.
Select install Ubuntu
Keyboard layout
Updates and other software
Installation type
Where do you live? I was born in Tokyo, raised in HIP HOP, and most of the bad guys are friends
Please enter your information
Installation Wait for a while until the installation is complete.
Reboot Restart.
docker, docker-compose After restarting, first install docker and docker-compoe.
Basically, install docker according to docker official.
python
sudo apt-get remove docker docker-engine docker.io containerd runc
# Update the apt package index and install packages to allow apt to use a repository over HTTPS:
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
# Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Use the following command to set up the stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below. Learn about nightly and test channels.
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
# docker install
sudo apt-get install docker-ce docker-ce-cli containerd.io
Set so that docker can be executed without root privileges.
python
sudo groupadd docker
sudo usermod -aG docker $USER
#It seems that it will be reflected if you log out, but it was not reflected in my environment
#Reboot once here.
sudo reboot
#After restarting, it is OK if docker is displayed
groups
python
# docker-Click here to install by specifying the version of ce
# List the versions available in your repo:
apt-cache madison docker-ce
#Example
sudo apt-get install docker-ce=5:19.03.12~3-0~ubuntu-bionic docker-ce-cli=5:19.03.12~3-0~ubuntu-bionic containerd.io
I will test
python
# Verify that Docker Engine is installed correctly by running the hello-world image.
sudo docker run hello-world
#Check if there is an image
docker ps -a
Looks okay
2. docker-compose
python
sudo apt install docker-compose
#Confirmation of installation
docker-compose -v
#OK if ↓ is displayed(Please read version as appropriate)
docker-compose version 1.17.1 build unknown
gitlab Finally it is the construction of gitlab. Let's take a look at gitlab official.
Since it imitates the official docker-compose.yml, first define the environment variables
python
#Create a folder first
sudo mkdir -p /srv/gitlab
#Environment variable
export GITLAB_HOME="/srv/gitlab"
python
#Create a suitable folder
mkdir gitlab && cd gitlab
# docker-compose.make yml
touch docker-compose.yml
#Open with editor and write the contents
gedit docker-compose.tml
docker-compose.yml
web:
image: 'gitlab/gitlab-ce:latest'
hostname: 'IP address of own PC'
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://IP address of own PC:80/gitlab/'
gitlab_rails['time_zone'] = 'Asia/Tokyo'
ports:
- '80:80'
- '443:443'
- '22:22'
volumes:
- '$GITLAB_HOME/config:/etc/gitlab'
- '$GITLAB_HOME/logs:/var/log/gitlab'
- '$GITLAB_HOME/data:/var/opt/gitlab'
docker-compose.yml looks like this. It seems that there are other setting items, so let's add them if necessary. Also, when considering operation, should I fix the version of gitlab? Also, if you already have a port in use, replace it with an appropriate number.
python
#Start gitlab
docker-compose up -d
It takes a long time to start. Let's wait patiently.
After starting, open a browser and hit the URL specified by external_url. It is OK if the screen below is displayed. After that, change the administrator PW and register the user from Register. Example: http: // IP address of your PC: 80 / gitlab /
Now you can build gitlab environment on ubuntu 18.04 using docker and docker-compose. When building in a company, it may be necessary to set proxy in ubuntu or docker, but at home it is OK like this. I'm grateful that you can build gitlab at home so easily. By the way, when I installed gitlab directly on ubuntu on-premise, it stopped working by updating the settings of gitlab for some reason and it didn't work. Well, it seems easier to use docker, so let's say Yoshi!
https://docs.docker.com/engine/install/ubuntu/ https://docs.gitlab.com/omnibus/docker/ https://qiita.com/soumi/items/baaa35b37f6c90a66c0c http://imamachi-n.hatenablog.com/entry/2018/04/29/193718 https://demura.net/deeplearning/16931.html
Thanks for the URL above.
Recommended Posts