How to enable "--privileged" flag when running Docker image?

I have success to build an image from my teacher Dockerfile like this:

FROM 32bit/ubuntu:16.04
ARG DEBIAN_FRONTEND=noninteractive

# Install software packages inside the container
RUN apt-get update && \
	apt-get -y install \   
	zsh \
	nasm \
	gcc \
	gdb \
	python \
	git \  
    	nano && \
	apt-get clean

# Create user 
RUN useradd -m -s /bin/bash seed && \
	echo "root:dees" | chpasswd && \
	echo "seed:dees" | chpasswd && \
	usermod -aG sudo seed  

USER seed
WORKDIR /home/seed
#RUN mkdir asm
RUN mkdir seclabs
RUN git clone https://github.com/longld/peda.git ~/peda
RUN echo "source ~/peda/peda.py" >> ~/.gdbinit

# The command executed by the container after startup
CMD [ "/bin/bash"]

Now how can I run this image with “–privileged” flag to set up a lab environment for my Computer Security subject? Please help me

This is error when I try to run this command: docker run -it --privileged -v $HOME/Seclabs:/home/seed/seclabs img4lab

docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "sysfs" to rootfs at "/sys": mount sysfs:/sys (via /proc/self/fd/7), flags: 0xe: operation not permitted: unknown.
ERRO[0000] error waiting for container: context canceled 

This seems like something @Vova or @davideast may have some suggestions here :slight_smile:

Unfortunately privileged docker container are not currently supported inside idx as docker daemon is running in rootless mode. It’s a restriction we may be able to eventually remove, but it’s not currently on the roadmap