Bug 1387423 - Cassandra Docker image currently running as root
Summary: Cassandra Docker image currently running as root
Keywords:
Status: VERIFIED
Alias: None
Product: Middleware Manager
Classification: JBoss
Component: Other
Version: 7.0.0 TP2
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
: ---
Assignee: Matt Wringe
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1386725
TreeView+ depends on / blocked
 
Reported: 2016-10-20 20:38 UTC by Paul Gier
Modified: 2022-03-31 04:27 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Paul Gier 2016-10-20 20:38:52 UTC
The Cassandra Docker image used by Hawkular Services (Cloudforms Middleware) is currently running as the root user.  This is not compatible with Kubernetes/Openshift so it needs to run as a non-root user.

Comment 2 Paul Gier 2016-10-25 20:32:24 UTC
I updated the docker-entrypoint.sh script so that it will switch to the cassandra user if the user starts the container as root.  I also verified that the container can be started with an arbitrary user id (docker run --user) as long as the correct permissions are set on the volume (/opt/apache-cassandra/data).

This works in a similar way to the upstream Cassandra docker image.

Comment 3 Paul Gier 2016-10-25 20:34:53 UTC
This issue can be verified by starting the container and then running the "ps" command to verify that the cassandra server is running as the cassandra user.
For example:
docker exec -ti <cassandra-container-id> ps aux

Comment 5 Luis Dipotet 2018-02-23 02:31:20 UTC
(In reply to Paul Gier from comment #2)
> I updated the docker-entrypoint.sh script so that it will switch to the
> cassandra user if the user starts the container as root.  I also verified
> that the container can be started with an arbitrary user id (docker run
> --user) as long as the correct permissions are set on the volume
> (/opt/apache-cassandra/data).
> 
> This works in a similar way to the upstream Cassandra docker image.

docker run --user is valid for docker BUT not for Openshift in which when the image is created is done as root so is the PaaS who run the  container and fail when try to deploy it.

Comment 6 Anjay 2018-11-03 09:38:10 UTC
Hi Luis,

Could you share the chnages you have made in docker-entrypoint.sh script 

Thanks,


Note You need to log in before you can comment on or make changes to this bug.