Start zookeeper with users uid in test-setup-docker.sh

The zookeeper containers entrypoint will try to switch to the user
'zookeeper' if the container is started with uid '0'. This can cause issues
when the uid for the zookeeper user inside the container and the
users uid outside the container differ since it will lead to zookeeper
getting access denied when trying to read the certificates.

This also adds logging configuration to make it easier to debug
zookeeper in the future.

Change-Id: I51db53fe093a294e804148f682053123f54adfe1
This commit is contained in:
Albin Vass 2022-03-24 17:38:36 +01:00
parent 3bce9b6d3e
commit 0cb099e1be
2 changed files with 4 additions and 2 deletions

View File

@ -26,6 +26,7 @@ services:
zookeeper:
container_name: zuul-test-zookeeper
user: "${USER_ID}"
image: zookeeper
environment:
- ZOO_AUTOPURGE_PURGEINTERVAL=1
@ -33,8 +34,8 @@ services:
ports:
- "2281:2281"
tmpfs:
- /data
- /datalog
- /data:uid=${USER_ID}
- /datalog:uid=${USER_ID}
volumes:
- "./ca:/var/certs:z"
- "./zoo.cfg:/conf/zoo.cfg:z"

View File

@ -39,6 +39,7 @@ CA_DIR=$SCRIPT_DIR/ca
mkdir -p $CA_DIR
$SCRIPT_DIR/zk-ca.sh $CA_DIR zuul-test-zookeeper
export USER_ID=$(id -u)
${COMPOSE} up -d
echo "Waiting for mysql"