File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -124,3 +124,32 @@ docker exec -it webserver nginx -t
124
124
docker exec -it webserver nginx -s reload
125
125
```
126
126
注意:⚠️ webserver 可以是 ` 容器名称 ` 或者 ` 容器ID `
127
+
128
+ ## 启用 Gitlab Registry 功能
129
+
130
+ 修改配置 ` /etc/gitlab/gitlab.rb ` 文件,将 ` registry_external_url ` 的值修改为 http://192.168.188.211:5008
131
+
132
+ ``` ruby
133
+ registry_external_url ' http://192.168.188.211:5008'
134
+ ```
135
+
136
+ ` registry_external_url ` 这个地址是我们使用 ` docker ` 命令进行 ` pull ` 或者 ` push ` 镜像的仓库地址。
137
+
138
+ 重启 ` Gitlab ` 后,可以在 ` Gitlab ` 左侧面板看到 ` Container Registry ` 的菜单。
139
+
140
+ 按照 gitlab 给出的提示,我们先登录上 gitlab 的 registry:
141
+
142
+ ``` bash
143
+ docker login 192.168.188.211:5008
144
+ Username: ****
145
+ Password: **
146
+ ```
147
+
148
+ 注意:⚠️ 密码是需要通过 [ Gitlab > User Settings > Access Tokens > Add a personal access token] ( http://gitlab.com/-/profile/personal_access_tokens ) 生成一个 ` personal_access_tokens ` 而不是真正的密码
149
+
150
+
151
+ ```
152
+ docker build -t 192.168.188.211:5008/docker/docker-static-service-template .
153
+ # 提交镜像
154
+ docker push 192.168.188.211:5008/docker/docker-static-service-template
155
+ ```
You can’t perform that action at this time.
0 commit comments