我想通过 Docker compose 在我的 Mac M2 中运行 Apache 超集。但它总是给我错误。
% docker compose up
WARN[0000] The "CYPRESS_CONFIG" variable is not set. Defaulting to a blank string.
WARN[0000] The "CYPRESS_CONFIG" variable is not set. Defaulting to a blank string.
[+] Running 1/1
! superset-websocket Warning 4.4s
[+] Building 2.2s (9/12) docker:desktop-linux
=> [superset-websocket internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.20kB 0.0s
=> [superset-websocket internal] load .dockerignore 0.0s
=> => transferring context: 842B 0.0s
=> [superset-websocket internal] load metadata for docker.io/library/node:16-alpine 2.2s
=> [superset-websocket auth] library/node:pull token for registry-1.docker.io 0.0s
=> [superset-websocket internal] load build context 0.0s
=> => transferring context: 1.80kB 0.0s
=> [superset-websocket stage-1 1/5] FROM docker.io/library/node:16-alpine@sha256:a1f9d027912b58a7c75be7716c97cfbc6d3099f3a97ed84aa490be9dee20e787 0.0s
=> CACHED [superset-websocket stage-1 2/5] WORKDIR /home/superset-websocket 0.0s
=> CACHED [superset-websocket build 3/4] COPY . ./ 0.0s
=> ERROR [superset-websocket build 4/4] RUN npm ci && npm run build 0.0s
------
> [superset-websocket build 4/4] RUN npm ci && npm run build:
------
failed to solve: no support for running processes with linux/amd64/v8 platform, supported: linux/amd64, linux/amd64/v2
我也运行了这个命令,但它没有解决我的问题。
export DOCKER_DEFAULT_PLATFORM=linux/x86_64/v8
我设法通过更新 docker compose 来构建超集:
platform: linux/amd64/v8
...
superset-websocket:
platform: linux/amd64
...
superset-init:
platform: linux/amd64/v8
...
superset-node:
platform: linux/amd64/v8
...
superset-worker:
platform: linux/amd64/v8
...
superset-worker-beat:
platform: linux/amd64/v8
...
superset-tests-worker:
platform: linux/amd64/v8
此处提到了修复:https://github.com/apache/superset/issues/25434。稍后你必须清除你设置的变量并从头开始构建:
export DOCKER_DEFAULT_PLATFORM=
docker-compose build --no-cache