docker run --name mattermost-preview \
--publish 8065:8065 \
--add-host dockerhost:127.0.0.1 \
--rm \
-d mattermost/mattermost-preview:5.4.0
上面命令直接在命令行运行,就可以使用,通常情况我们想映射配置和存储,以便删除容器数据还存在,避免数据丢失。首先我们需要通过上面运行好的容器,将里面的配置拷贝出来。
docker container cp mattermost-preview:/mm/mattermost/config $HOME/_docker/mattermost/
docker run --name mattermost-preview \
--publish 8065:8065 \
--add-host dockerhost:127.0.0.1 \
-v $HOME/_docker/mattermost/config:/mm/mattermost/config \
-v $HOME/_docker/mattermost/mysql:/var/lib/mysql \
-v $HOME/_docker/mattermost/data:/mm/mattermost-data \
-d mattermost/mattermost-preview:5.4.0
"GitLabSettings": {
"Enable": true,
"Secret": "{mattermost-app-secret-from-gitlab}",
"Id": "{mattermost-app-application-id-from-gitlab}",
"Scope": "",
"AuthEndpoint": "https://{gitlab-site-name}/oauth/authorize",
"TokenEndpoint": "https://{gitlab-site-name}/oauth/token",
"UserApiEndpoint": "https://{gitlab-site-name}/api/v4/user"
}
vim /etc/gitlab/gitlab.rb
mattermost_external_url 'http://mattermost.example.com'
gitlab_rails['mattermost_host'] = "https://mattermost.example.com"
mattermost['gitlab_enable'] = true
mattermost['gitlab_id'] = "12345656"
mattermost['gitlab_secret'] = "123456789"
mattermost['gitlab_scope'] = ""
mattermost['gitlab_auth_endpoint'] = "http://gitlab.example.com/oauth/authorize"
mattermost['gitlab_token_endpoint'] = "http://gitlab.example.com/oauth/token"
mattermost['gitlab_user_api_endpoint'] = "http://gitlab.example.com/api/v4/user"
"ServiceSettings": {
"SiteURL": "http://mattermost.example.com",
}