1

我正在使用 MACOSX 来运行和测试我的一些服务,我也在使用 localstack ( https://github.com/localstack/localstack ) 来模拟 s3、sqs 和 sns 但这似乎不能正常工作。

我已经将 docker 的计算能力和内存增加到了最大值。

C-LM-0792:Desktop UserName$ git clone git@github.com:localstack/localstack.git
Cloning into 'localstack'...
Enter passphrase for key '/Users/UserName/.ssh/id_rsa': 
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 6741 (delta 0), reused 4 (delta 0), pack-reused 6726
Receiving objects: 100% (6741/6741), 2.23 MiB | 1.92 MiB/s, done.
Resolving deltas: 100% (4397/4397), done.
C-LM-0792:Desktop UserName$ cd localstack/
C-LM-0792:localstack UserName$ make infra
(. .venv/bin/activate; exec bin/localstack start)
/bin/sh: .venv/bin/activate: No such file or directory
make: *** [infra] Error 1
C-LM-0792:localstack UserName$ make web
(. .venv/bin/activate; bin/localstack web)
/bin/sh: .venv/bin/activate: No such file or directory
make: *** [web] Error 1
4

2 回答 2

1

您可以使用@brian 在评论中指出的以下 docker-compose 文件:

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:27:11.607 回答
1

Commandeer中,您可以查看您的 LocalStack 实例。在后台它使用上述 docker 实例,但您可以从 GUI 启动和停止服务。它还在终端选项卡中打印出终端的内容。我会为它走 docker 路线,因为现在这是他们推荐的方式。

在此处输入图像描述

于 2020-03-18T15:40:30.543 回答