我们在 Windows 10 上运行 Docker。我们有一个简单的 Java Springboot 应用程序,它应该与 AWS Kinesis 和 S3 交互。对于本地测试,我们要拉取 localstack Docker 最新镜像并安装并运行。但是 Kinesis 的启动会引发错误,而 S3 工作正常。以下是详细信息:
docker compose:
version: '3.1'
services:
localstack:
image: "localstack/localstack"
container_name: localstack_demo
environment:
SERVICES: kinesis, s3, sqs
DEBUG: 1
DATA_DIR: /tmp/localstack
KINESIS_STREAM_SHARDS: 1
KINESIS_ERROR_PROBABILITY: 0.0
KINESIS_STREAM_NAME: my-stream
ports:
- "4567-4584:4567-4584"
- "8055:8080"
volumes:
- './.localstack:/tmp/localstack'
- '/var/run/docker.sock:/var/run/docker.sock'
当我们尝试点击 Kinesis 的默认 URL 时http://localhost:4568
,我们收到以下错误:(请注意,S3 的默认 URL 会按预期响应):
localstack_demo | 2019-09-24T22:35:27:ERROR:localstack.services.generic_proxy: Error forwarding request: the JSON object must be str, bytes or bytearray, not 'NoneType' Traceback (most recent call last):
localstack_demo | File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
localstack_demo | path=path, data=data, headers=forward_headers)
localstack_demo | File "/opt/code/localstack/localstack/services/kinesis/kinesis_listener.py", line 22, in forward_request
localstack_demo | data = json.loads(to_str(data))
localstack_demo | File "/usr/lib/python3.6/json/__init__.py", line 348, in loads
localstack_demo | 'not {!r}'.format(s.__class__.__name__))
localstack_demo | TypeError: the JSON object must be str, bytes or bytearray, not 'NoneType'
我的码头安装:
$ docker info
Containers: 3
Running: 2
Paused: 0
Stopped: 1
Images: 169
Server Version: 18.09.9
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.14.141-boot2docker
Operating System: Boot2Docker 18.09.9 (TCL 8.2.1)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 989.4 MiB
Name: default
ID: QYOP:66HM:CLYX:77QX:UJES:37LA:JTFL:ER2U:2ZDA:HNNM:JWNN:CBOA
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
provider=virtualbox
Insecure Registries:
127.0.0.0/8
任何指针将不胜感激