Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker start privileged?

Tags:

docker

I'm quite new to docker.I have a docker container running.

[root@vm Downloads]# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
fc86020fff36        centos:6.6          "/bin/bash"         5 days ago          Up 17 hours                             drunk_tesla  

I want to stop this vm and run it as --privileged. But I have bunch of things in this docker.

I don't want to use --run because it creates a new docker instance and i have to re-do everything.

Is there anyway i can stop and start the docker container in privileged mode?

Thanks, r

like image 289
TechnoCorner Avatar asked Sep 02 '15 19:09

TechnoCorner


1 Answers

Since the docker image you used (centos:6.6) for creating this container has no volumes, that means that any data you modified in this container is written on the container filesystem itself (as opposed to on a docker volume).

The docker commit command will take the content of a container filesystem (excluding volumes) and produce a new docker image from it. This way you will be able to create a new container from that new image that will have the same content.

docker commit drunk_tesla mycentosimage
docker run -it --privileged mycentosimage bash
like image 89
Thomasleveil Avatar answered Oct 09 '22 23:10

Thomasleveil