Until now I’ve accessed the docker image witthout being a root user by doig the following:
- Create docker file
- Add the following:
##########################################
# Dockerfile to change from root to
# non-root privilege
###########################################
# Base image is CentOS
FROM centos:latest
# Add a new user "spinalcordtoolbox" with user id 8877
RUN yum -y install git bzip2 gcc wget which mesa-libGL unzip
RUN git clone https://github.com/neuropoly/spinalcordtoolbox.git sct
RUN cd sct && yes | ./install_sct
RUN echo $PATH
RUN export PATH="/sct/bin:${PATH}"
RUN wget https://www.neuro.polymtl.ca/_media/downloads/sct/20190121_sct_course-london19.zip
RUN unzip 20190121_sct_course-london19.zip
RUN useradd -u 8877 spinalcordtoolbox
# Change to non-root privilege
USER spinalcordtoolbox
- Run:
docker image build -t spinalcord .
to build the image
- Run
docker run -it spinalcord:latest
to access the image.
- Run:
cd sct_course-london19/single_subject/data/t2
sct_label_utils -i t2.nii.gz -create-viewer 1,2,3,4,5,6,7 -o t2label
But now I get a permissions error:
Command-line usage error: Option -o no write permission for file t2label
Aborted...
If I run the command without -o
, then I get the same error as when running the command being a root user:
[spinalcordtoolbox@4e6403b56129 t2]$ sct_label_utils -i t2.nii.gz -create-viewer 1,2,3,4,5,6,7
--
Spinal Cord Toolbox (git-master-22f44e7316e75517ac3f056147ceb9db58e0c331)
generated new fontManager
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
So until now I guess the error dosen’t depend on the user’s type since the same error happens weather the user has root access or not.
I’ll dig further into this.