Hi,
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:
- Dockerfile
FROM splunk/universalforwarder:latest
USER 9999
Running command
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
Digest: sha256:37d48e3733cf3d987d37401268f341c48e1dda6f7fc68281b8aeaa40f84b0135
Status: Downloaded newer image for splunk/universalforwarder:latest
---> 1adf45780dc6
Step 2/2 : USER 9999
---> Running in 97fbfea0e6ae
Removing intermediate container 97fbfea0e6ae
---> cb653fda417a
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?
Thanks
... View more