0

kompose使用brew安装。

当我跑步时,kompose up我得到

ERRO Unable to push image 'tolicodes/tolicodes.com:latest' to registry 'docker.io'. Error: errors:
denied: requested access to the resource is denied
unauthorized: authentication required

我的~/.docker/config.json样子:

{
    "auths": {
        "https://index.docker.io/v1/": {}
    },
    "HttpHeaders": {
        "User-Agent": "Docker-Client/19.03.8 (darwin)"
    },
    "credsStore": "desktop",
    "experimental": "disabled",
    "stackOrchestrator": "swarm"
}

我的docker-compose.yml

version: "3.4"
services:
  frontend-dev:
    build:
      context: .
      target: dev
    ports:
      - "3000:3000"
    volumes:
      - .:/app
      - /app/node_modules
    stdin_open: true
  frontend:
    build:
      context: .
      target: prod
    ports:
      - "80:80"
    image: tolicodes/tolicodes.com

我已经成功运行docker login

4

1 回答 1

0

我必须将 base64 编码的用户名/密码添加到配置中

echo -n 'username:password'  | base64

~/.docker/config.json

"auths": {
    "https://index.docker.io/v1/": {
      "auth": "<THE OUTPUT>"
    }
  },
于 2020-04-28T11:10:32.827 回答