I have a docker container running Couchbase, and I need to perform an operation on it that requires the couchbase-server service to temporarily stop. This is required to overwrite some configuration files within the container. Operation steps are described below.
docker exec -it "bumblebase" bash -c "systemctl stop couchbase-server"
docker exec -it "bumblebase" bash -c "echo \"{rest_port, 3456}.\" >> \"/opt/couchbase/etc/couchbase/static_config\""
docker exec -it "bumblebase" bash -c "rm -rf /opt/couchbase/var/lib/couchbase/config/config.dat"
docker exec -it "bumblebase" bash -c "systemctl start couchbase-server"
Running this gives me the following error ;
Failed to connect to bus: No such file or directory
I only found one workaround for it, from the following stackoverflow answer. However, I am not fine with modifying couchbase default image, plus the alternate image is marked as unmaintend for a while now.
I also tried this alternate command from couchbase documentation :
docker exec -it "bumblebase" bash -c "service couchbase-server stop"
But then I have another error :
couchbase-server: unrecognized service
I just want the couchbase-server service to stop within the container, is it possible ? Or is it an alternative solution to overwrite my config files ?