I am running a docker image locally and getting the following error message:
docker run -p 80:80 -it [aws_id].dkr.ecr.us-west-2.amazonaws.com/temporal-workflows:12d8523b2e2ea02e911937e505c6a98dd5f6c22a
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
dummy log here
another 1
TransportError: tonic::transport::Error(Transport, hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 99, kind: AddrNotAvailable, message: "Cannot assign requested address" })))
at Function.connect (/opt/app-root/src/.yarn/cache/@temporalio-worker-npm-1.0.1-71d563dea6-c05226a9af.zip/node_modules/@temporalio/worker/lib/connection.js:56:23)
at async run (/opt/app-root/src/packages/temporal-workflows/dist/main.js:30:18)
It seems to fail at this LoC where i try to connect to the temporal server:
but i have the temporal server running locally at that host:
➜ temporal-workflows git:(jackwang/solve-temporal-worker-bug) ✗ docker container ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5f557fbcf05a temporalio/ui:2.1.0 "./start-ui-server.sh" 4 weeks ago Up About a minute 0.0.0.0:8080->8080/tcp temporal-ui
61dbc0edc365 temporalio/admin-tools:1.17.0 "tail -f /dev/null" 4 weeks ago Up About a minute temporal-admin-tools
34a21853fa49 temporalio/auto-setup:1.17.0 "/etc/temporal/entry…" 4 weeks ago Up About a minute 6933-6935/tcp, 6939/tcp, 7234-7235/tcp, 7239/tcp, 0.0.0.0:7233->7233/tcp temporal
➜ temporal-workflows git:(jackwang/solve-temporal-worker-bug) ✗ docker port 34a21853fa49
7233/tcp -> 0.0.0.0:7233
When you create your container via docker run I believe in order for containers to communicate by name they should be on same network, so for example try adding
docker run ... --network <network>
using the previously mentioned docker container ls command you should be able to see the network name as well:
docker container ls --format "table {{.ID}}\t{{.Image}}\t{{.Names}}\t{{.Network}}"
see if that helps.
Alternatively just push your image to docker via docker push or docker build if you have a Dockerfile for it and then add your service via docker compose yaml something like: