小编vin*_*ran的帖子

docker-compose错误无效类型,它应该是一个字符串

我有这样的 docker-compose 设置

version: "3.2"

services:
   gitlab:
       image: gitlab/gitlab-ce:latest
       container_name: gitlab-container
       restart: always
       environment:
           - GITLAB_OMNIBUS_CONFIG: |
                   external_url 'https://192.46.223.235'
                   gitlab_rails['gitlab_shell_ssh_port'] = 10022
                   letsencrypt['enabled'] = false
                   nginx['enable'] = true
                   nginx['redirect_http_to_https'] = false
                   nginx[listen_port] = 10080
                   nginx[listen_https] = false
       ports:
           - "10080:80"
           - "10022:22"

       volumes:
           - '$GITLAB_HOME/config:/etc/gitlab'
           - '$GITLAB_HOME/logs:/var/log/gitlab'
           - '$GITLAB_HOME/data:/var/opt/gitlab'
Run Code Online (Sandbox Code Playgroud)

因此,当我运行 docker-compose up -d 时,出现以下错误:

WARNING: The GITLAB_HOME variable is not set. Defaulting to a blank string.
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.gitlab.environment contains {"GITLAB_OMNIBUS_CONFIG": "-  external_url 'https://192.46.223.235'\n- …
Run Code Online (Sandbox Code Playgroud)

docker docker-compose gitlab-omnibus gitlab-ce

15
推荐指数
1
解决办法
3万
查看次数

'anyObject'不能转换为'Dictionary <key,value>]'

嗨,我想通过使用NSUserDefaut获取对象类型字典:

var favoritePlace = NSUserDefaults.standardUserDefaults().objectForKey("savePlace")!  as [Dictionary]
Run Code Online (Sandbox Code Playgroud)

但我得到错误'anyObject'不能转换为'Dictionary]'

我也尝试:

var favoritePlace = NSUserDefaults.standardUserDefaults().objectForKey("savePlace")!  as [Dictionary<String, String>()]
Run Code Online (Sandbox Code Playgroud)

但它也不起作用.谁知道我怎么能这样做?谢谢 !

dictionary nsuserdefaults swift

2
推荐指数
1
解决办法
3787
查看次数