我试图构建我的服务,但是当我使用docker-composite up--build时,我收到以下信息:
错误[内部]加载www.example.com 0.9s的元数据=〉[身份验证]库/python:提取www.example.com 0.0s的令牌 docker.io/library/python:3.10-alpine 0.9s => [auth] library/python:pull token for registry-1.docker.io 0.0s
[内部]加载www.example.com的元数据docker.io/library/python:3.10-alpine:
无法使用前端dockerfile.v0进行解析:无法创建LLB定义:清单sha256中没有匹配的平台:075028375723487287022732372384723874283782348237837:未找到
这个问题是出现在我已经更新我的mac到Ventura 13.0.1,从我收集的似乎是操作系统导致这个问题。我有2个服务(数据库和api)的数据库可以旋转,但我的api返回上述问题。
我试过了:
docker-compose up --build
docker pull docker.io/library/python:3.10-alpine
docker ps -a
确保Docker守护程序正在运行清除我的图像
停靠文件
FROM python:3.10-alpine
docker-compose.yml
version: '3.9'
services:
my_db:
image: postgres:14-alpine
container_name: my_db
environment:
POSTGRES_USER: "${DB_USERNAME}"
POSTGRES_PASSWORD: "${DB_PASSWORD}"
POSTGRES_DB: "${DB_NAME}"
ports:
- "127.0.0.1:5432:${DB_PORT}"
volumes:
- ./database:/var/lib/postgresql/data
deploy:
mode: global
resources:
limits:
cpus: '1'
memory: 128M
pid: isolated
security_opt:
- no-new-privileges:true
cap_drop:
- NET_ADMIN
- SYS_ADMIN
networks:
- db
my_api:
build:
context: .
dockerfile: Dockerfile
depends_on:
posts_db:
condition: service_healthy
container_name: my_api
platform: linux/amd64/v8
environment:
CURRENT_ENVIRONMENT: local_docker
DB_HOST: "${DB_HOST}"
DB_PORT: "${DB_PORT}"
DB_NAME: "${DB_NAME}"
DB_USERNAME: "${DB_USERNAME}"
DB_PASSWORD: "${DB_PASSWORD}"
security_opt:
- no-new-privileges:true
deploy:
mode: global
endpoint_mode: vip
resources:
limits:
cpus: '1'
memory: 128M
ports:
- "127.0.0.1:8000:8000"
volumes:
- /app/database
- ./:/app
networks:
- api
- db
networks:
api:
db:
1条答案
按热度按时间58wvjzkj1#
我在我的Dockerfile中搜索“--platform =linux/amd 64”的答案如下
这个问题是在我将我的macos更新到Ventura 13. 0. 1后遇到的