我正在尝试从Docker启动RabbitMQ 3.10,它运行在Apple Silicon(M1)上的MacOSX上。在Linux中,我可以做到:
docker run --rm --name my-rabbit rabbitmq:3.10.18-management
我可以在控制台中看到,一切似乎都正常启动:
023-03-02 13:57:33.756849+00:00 [info] <0.223.0> Feature flags: list of feature flags found:
2023-03-02 13:57:33.762401+00:00 [info] <0.223.0> Feature flags: [ ] classic_mirrored_queue_version
2023-03-02 13:57:33.762435+00:00 [info] <0.223.0> Feature flags: [ ] classic_queue_type_delivery_support
2023-03-02 13:57:33.762462+00:00 [info] <0.223.0> Feature flags: [ ] implicit_default_bindings
2023-03-02 13:57:33.762484+00:00 [info] <0.223.0> Feature flags: [ ] maintenance_mode_status
2023-03-02 13:57:33.762501+00:00 [info] <0.223.0> Feature flags: [ ] quorum_queue
2023-03-02 13:57:33.762522+00:00 [info] <0.223.0> Feature flags: [ ] stream_queue
2023-03-02 13:57:33.762537+00:00 [info] <0.223.0> Feature flags: [ ] user_limits
2023-03-02 13:57:33.762554+00:00 [info] <0.223.0> Feature flags: [ ] virtual_host_metadata
2023-03-02 13:57:33.762571+00:00 [info] <0.223.0> Feature flags: feature flag states written to disk: yes
2023-03-02 13:57:33.903041+00:00 [notice] <0.44.0> Application syslog exited with reason: stopped
2023-03-02 13:57:33.903117+00:00 [notice] <0.223.0> Logging: switching to configured handler(s); following messages may not be visible in this log output
2023-03-02 13:57:33.909335+00:00 [notice] <0.223.0> Logging: configured log handlers are now ACTIVE
2023-03-02 13:57:33.993055+00:00 [info] <0.223.0> ra: starting system quorum_queues
2023-03-02 13:57:33.993109+00:00 [info] <0.223.0> starting Ra system: quorum_queues in directory: /var/lib/rabbitmq/mnesia/parkster-itest@f77e2b1ba2e8/quorum/parkster-itest@f77e2b1ba2e8
2023-03-02 13:57:34.018706+00:00 [info] <0.259.0> ra system 'quorum_queues' running pre init for 0 registered servers
2023-03-02 13:57:34.022754+00:00 [info] <0.260.0> ra: meta data store initialised for system quorum_queues. 0 record(s) recovered
..
然而,在Mac上,我通常需要添加
--platform linux/x86_64
,但这似乎不适用于RabbitMQ 3.10:
docker run --rm --platform linux/x86_64 --name my-rabbit rabbitmq:3.10.18-management
我根本没有得到任何日志打印到控制台,包括没有错误消息,但容器只是在一秒钟左右后停止:
$ time docker run --rm --platform linux/x86_64 --name my-rabbit rabbitmq:3.10.18-management
docker run --rm --platform linux/x86_64 --name my-rabbit 0.02s user 0.01s system 1% cpu 1.411 total
运行旧版本的RabbitMQ似乎可以工作:
docker run --rm --platform linux/x86_64 --name my-rabbit rabbitmq:3.8.9
如何在Mac M1上的Docker上启动RabbitMQ的3.10或更高版本?