0

在 docker 上运行 localstack 时出现以下错误。

localstack_1               | 2019-08-06 21:07:03,019:API: 127.0.0.1 - - [06/Aug/2019 21:07:03] "PUT /namely-protorepo-descriptor-ops/protodefs/10/ximble/service.protoset HTTP/1.1" 200 -
localstack_1               |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/requests/api.py", line 60, in request
localstack_1               |     return session.request(method=method, url=url, **kwargs)
localstack_1               |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
localstack_1               |     resp = self.send(prep, **send_kwargs)
localstack_1               |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
localstack_1               |     r = adapter.send(request, **kwargs)
localstack_1               |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
localstack_1               |     raise ConnectionError(e, request=request)
localstack_1               | requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=4563): Max retries exceeded with url: /namely-protorepo-descriptor-ops (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f2fe08a70f0>: Failed to establish a new connection: [Errno 111] Connection refused',))

这是我的码头工人撰写:

  localstack:
    image: localstack/localstack
    ports:
      - "4560-4590:4560-4590"
      - "8055:8080"
    environment:
      - SERVICES=s3
      - DEFAULT_REGION=us-east-1
      - DEBUG=1
4

1 回答 1

0

您可以使用以下docker-compose.yaml文件:

version: '2.1'

services:
  localstack:
    container_name: "${LOCALSTACK_DOCKER_NAME-localstack_main}"
    image: localstack/localstack
    ports:
      - "4567-4599:4567-4599"
      - "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
    environment:
      - SERVICES=${SERVICES- }
      - DEBUG=${DEBUG- }
      - DATA_DIR=${DATA_DIR- }
      - PORT_WEB_UI=${PORT_WEB_UI- }
      - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR- }
      - KINESIS_ERROR_PROBABILITY=${KINESIS_ERROR_PROBABILITY- }
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - "${TMPDIR:-/tmp/localstack}:/tmp/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"
于 2020-02-12T15:29:41.440 回答