ERROR: Required directory /var/lib/solace is not writable by current user
i am trying to create my first docker container for solace, but getting the below error
i used the below command :
sudo docker run --mount type=bind,source=/mnt/solace,target=/var/lib/solace -d -p 8080:8080 -p 55555:55555 --shm-size=1g --env 'username_admin_globalaccesslevel=admin' --env 'username_admin_password=admin' --name=solace solace/solace-pubsub-standard
ERROR: Required directory /var/lib/solace is not writable by current user
ERROR: Required directory /var/lib/solace is not writable by current user
ERROR: Unable to create required directory /var/lib/solace/diagnostics: [Errno 13] Permission denied: '/var/lib/solace/diagnostics'
ERROR: Required directory /var/lib/solace/diagnostics does not exist
ERROR: Unable to create required directory /var/lib/solace/spool: [Errno 13] Permission denied: '/var/lib/solace/spool'
Comments
-
Hi @Ankur lodhi,
If you're just getting started with the container and trying to test things out then you shouldn't need to externally mount the storage. Just use the command for your OS here:
But if you do need to mount the storage as you are then I got this response from our chat with docs AI bot, it's pretty smart! Hope it helps :)
0 -
The user and group that the AI is using above is incorrect. https://docs.solace.com/Software-Broker/Container-Tasks/Config-Arbitrary-User.htm it should be 1000001. Where did you get that Docker create command from?
But yeah, don't worry about mounting the storage! Especially for first time, just a test/demo broker. This is really only useful when doing upgrades, to make sure your configuration carries on. But if you really want, as the AI chat said above, you have to set the owner of the directory.
Only other thing I'd recommend: expose more ports… 55555 and 8080 are like the bare minimum for usefulness. https://docs.solace.com/Admin/Default-Port-Numbers.htm#Software
Here's my Docker create script I use:
$ cat docker-create.sh #!/bin/bash docker create \ --hostname=solace1081b \ --shm-size=1g \ --ulimit core=-1 \ --ulimit memlock=-1 \ --ulimit nofile=2448:38048 \ --cap-add=IPC_LOCK \ --cap-add=SYS_NICE \ -p 8080:8080 \ -p 2222:2222 \ -p 55555:55555 \ -p 55003:55003 \ -p 8008:8008 \ -p 1883-1885:1883-1885 \ -p 8000-8002:8000-8002 \ -p 5672-5674:5672-5674 \ -p 9000-9002:9000-9002 \ -p 5550:5550 \ --env 'username_admin_globalaccesslevel=admin' \ --env 'username_admin_password=admin' \ --restart unless-stopped \ --name=solace1081b solace/solace-pubsub-standard:latest
I just change the hostname and docker container name each time I make a new version.
1