Install the Docker

Install the Docker App

If it is m1 chip, choose Apple

I use the M1 version of Mac Mini installation has compatibility problems, successful partners can share under 🙏

The process is as simple as installing a regular Mac App, as shown here

Install the portainer

Portainer is a Docker visualization tool that allows you to view and manage Containers and images

Open the terminal, enter the command and press Enter

docker run -d -v "/var/run/docker.sock:/var/run/docker.sock" -p 9000:9000 portainer/portainer
Copy the code

Run after installation is complete

docker run -d -p 9000:9000 --restart=always -v /var/run/docker.sock:/var/run/docker.sock --name portainer  docker.io/portainer/portainer
Copy the code

When the browser opens localhost:9000, the user will be asked to enter the admin password at the beginning, and then enter the password to confirm. Since it is used locally, I directly select Local and then connect. The final interface is as follows:

Install gitlab

* /XXX/XXX * /XXX * /XXX * /XXX * /XXX * /XXX * /XXX * /XXX

sudo docker run --detach \ --hostname mygitlab.com \ --publish 443:443 --publish 80:80 --publish 22:22 \ --name gitlab \  --restart always \ --volume ~/srv/gitlab/config:/etc/gitlab \ --volume ~/srv/gitlab/logs:/var/log/gitlab \ --volume ~/srv/gitlab/data:/var/opt/gitlab \ gitlab/gitlab-ce:latestCopy the code

Some installation issues

After installing Docker, I opened Gitlab in the browser and did not set the password of the administrator such as root admin, so I could not log in

1. Open the terminal and enter the command

docker psLocate the built GitLab image

2. Determine the name of the Gitlab image and type the following command

docker exec -it gitlab HaoGitlab bash

3. Then enter the gitLab mirror and enter the command

root@mygitlab:/# gitlab-rails console -e production

See the following output


Ruby: Ruby 2.7.5P203 (2021-11-24 Revision F69AEb8314)

FOSS GitLab: 14.5.2 ceea558aa (76)

 GitLab Shell: 13.22.1

 PostgreSQL:   12.7


Loading production environment (Rails 6.1.4.1)

4. Find user root: the first user

irb(main):003:0> user = User.where(id:1).first

=> #<User id:1 @root>

5, set and confirm the password, remember to save

irb(main):004:0> user.password = '12345678'

= > “12345678”

irb(main):005:0> user.password_confirmation = '12345678'

= > “12345678”

irb(main):006:0> user.save!

=> true

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — set up — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — –