Export RabbitMQ Docker image with vhost and queues

2019-09-18 05:46发布

问题:

I have a rabbitMQ docker container that I started using the following command:

docker run -d --name myrabbit1 -p 15672:15672 rabbitmq:3-management

I then loggin to the management plugin and create users, vhosts, queues, etc.

I want to save all those settings so they can be loaded up again. To do that I tried committing to a new image:

docker commit myrabbit1 vbrabbit:withVhostAndQueues

I then start up my new container (after stopping the old one):

docker run -d --name vbrabbit2 -p 15672:15672 -p 5672:5672 vbrabbit:withVhostAndQueues

I expect that all the queues, vhosts, etc would be saved, but they are not.

What am I missing?

Result from docker ps -a:

回答1:

I want to save all those settings so they can be loaded up again

are you needing to create a copy of the container, with the same settings?

or are you just looking to docker stop myrabbit1 and then later docker start myrabbit to run the same container, again?