I want to run splunk-universalforwarder with non-root user. I created my own docker image and tried to run it.
But when I run the docker image and it return error as "sh: 1: cannot create /opt/container_artifact/splunk-container.state: Permission denied".
Details as below:
docker build ./ -t uf_9999
Sending build context to Docker daemon 1.723MB
Step 1/2 : FROM splunk/universalforwarder:latest
latest: Pulling from splunk/universalforwarder
27833a3ba0a5: Already exists
669cca39e74e: Pull complete
4fb681d8edc0: Pull complete
3056b53853fb: Pull complete
660149c27f87: Pull complete
e471a3f1dc9a: Pull complete
5f8d48462400: Pull complete
166bfc206ee8: Pull complete
5ebb6bc9ea16: Pull complete
Status: Downloaded newer image for splunk/universalforwarder:latest
Step 2/2 : USER 9999
---> Running in 97fbfea0e6ae
Removing intermediate container 97fbfea0e6ae
Successfully built cb653fda417a
Successfully tagged uf_9999:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
λ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
uf_9999 latest cb653fda417a 27 seconds ago 219MB
λ docker run -e "SPLUNK_START_ARGS=--accept-license" -e "SPLUNK_USER=splunk" cb653fda417a
WARNING: No password ENV var. Stack may fail to provision if splunk.password is not set in ENV or a default.yml
sh: 1: cannot create /opt/container_artifact/splunk-container.state: Permission denied
I did tried change USER to 999 but it resulted the same.
Does anyone know how could i resolve this error?
... View more