Docker返回“json:无法将字符串解组为Go类型[]string的值”

huangapple go评论82阅读模式
英文:

Docker returns "json: cannot unmarshal string into Go value of type []string"

问题

我对Docker还不太熟悉,但我可以帮你翻译一下你的问题和相关信息。

我是新手使用Docker。我尝试使用以下命令启动一个镜像:

fig up -d --allow-insecure-ssl

但是我收到以下错误信息:

json: 无法将字符串解组为类型为 []string 的Go值

我无法弄清楚如何修复它。

我的 fig.yml 文件内容如下:

configrepo:
  image: docker-registry.backbasecloud.com/backbase/engage-configuration:latest
  environment:
    - SERVICE_NAME=configuration
  ports:
      - "8788:8080"

configserver:
  image: docker-registry.backbasecloud.com/backbase/engage-configserver:latest
  environment:
    SERVICE_NAME: configserver
  ports:
    - "8888:8888"
  links:
    - configrepo:configrepo
  dns: 172.17.42.1

docker 版本信息如下:

客户端版本: 1.6.2
客户端 API 版本: 1.18
Go 版本 (客户端): go1.4.2
Git 提交 (客户端): 7c8fca2
操作系统/架构 (客户端): darwin/amd64
服务器版本: 1.8.2
服务器 API 版本: 1.20
Go 版本 (服务器): go1.4.2
Git 提交 (服务器): 0a8c2e3
操作系统/架构 (服务器): linux/amd64

fig 版本信息如下:

fig 1.0.1

有任何想法为什么会出现这个错误吗?

英文:

I'm new to docker. I tried to launch an image with:

fig up -d --allow-insecure-ssl

But I get the following error message:

json: cannot unmarshal string into Go value of type []string

And I can't figure out how to fix it.

My fig.yml:

configrepo:
  image: docker-registry.backbasecloud.com/backbase/engage-configuration:latest
  environment:
    - SERVICE_NAME=configuration
  ports:
      - "8788:8080"

configserver:
  image: docker-registry.backbasecloud.com/backbase/engage-configserver:latest
  environment:
    SERVICE_NAME: configserver
  ports:
    - "8888:8888"
  links:
    - configrepo:configrepo
  dns: 172.17.42.1

docker version

Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 7c8fca2
OS/Arch (client): darwin/amd64
Server version: 1.8.2
Server API version: 1.20
Go version (server): go1.4.2
Git commit (server): 0a8c2e3
OS/Arch (server): linux/amd64

fig --version

fig 1.0.1

Any ideas why I'm getting this error?

答案1

得分: 2

首先,fig 已经迁移到了 docker compose

其次,docker 1.6.2 不是最新版本的 docker。

所以,在过多追踪这个 bug 之前(考虑到类似 1638 的问题):

  • 更新到 docker compose 和 docker 1.8.2

  • 检查你的 docker-compose.yml 中的 entrypoint:例如,true 应该是 /bin/true

英文:

First, fig has long been migrated to docker compose.
Second, docker 1.6.2 is not the newest release of docker.

So before chasing that bug too much (in light of issues like 1638):

  • update to docker compose and docker 1.8.2

  • check your entrypoint in your docker-compose.yml: true should be /bin/true for instance.

huangapple
  • 本文由 发表于 2015年10月6日 15:11:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/32963846.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定