Closed chobostar closed 1 year ago
build image with name redis7
$ docker build . -t redis7
run 2 containers - without and with 'runAsUser' option:
$ docker run --rm --name test-uid -d redis7 $ docker run --rm --name test-uid-1001 --user 1001 -d redis7``` # make sure that config file and data directory is writeable $ docker exec test-uid bash -c "echo 1 > /etc/redis/redis.conf" $ echo $? 0 $ docker exec test-uid bash -c "echo 1 > /data/1" $ echo $? 0 # make sure that config file and data directory is writeable for '1001 user' $ docker exec test-uid-1001 bash -c "echo 1 > /data/1" $ echo $? 0 $ docker exec test-uid-1001 bash -c "echo 1 > /etc/redis/redis.conf" $ echo $? 0
no errors
Let's check intended users:
$ docker exec test-uid bash -c "echo $UID" 1000 $ docker exec test-uid-1001 bash -c "echo $UID" 1000
$ docker exec test-uid bash -c "whoami" redis $ docker exec test-uid-1001 bash -c "whoami" whoami: unknown uid 1001
UIDs as expected
Dear maintainers @shubham-cmyk @iamabhishek-dubey @sandy724
I respect your time and effort, but if you get a chance to look at this fix - Openshift users will be happy to use redis v7.
Thanks anyway!
This PR addresses next issues:
How I tested it
build image with name redis7
run 2 containers - without and with 'runAsUser' option:
no errors
Let's check intended users:
UIDs as expected