ubuntu - Can docker write to a cd? -
can docker write cd? can docker execute
cdrecord dev=/dev/sr0 -checkdrive
from ubuntu container?
docker seems able use parent's network hardware, why can't use parents cdrom/dvd device?
update:
this question programming in have shell script run on ubuntu vm , want know if feasible migrate docker. apologize not pointing out :)
i suppose (not tested yet), can find example in docker run
script:
docker run \ -t --rm \ --privileged \ -v $xsock:$xsock \ -v /etc/localtime:/etc/localtime:ro \ -v /dev/sr0:/dev/sr0 \ -v /dev/cdrom:/dev/cdrom \ -v $rips:/rips \ --name handbrake marvambass/handbrake &
as mentioned in comments luca, --privileged
flag required (docker run
):
by default, potentially dangerous kernel capabilities dropped; including
cap_sys_admin
(which required mount filesystems). however,--privileged
flag allow run.the
--privileged
flag gives all capabilities container, , lifts limitations enforced devicecgroup
controller.
in other words, container can host can do.
flag exists allow special use-cases, running docker within docker.
as vincent demeester mentions in comments, there --device
option:
it necessary directly expose devices container.
--device
option enables that.
example, specific block storage device or loop device or audio device can added otherwise unprivileged container (without--privileged
flag) , have application directly access it.by default, container able read, write ,
mknod
these devices. can overridden using third:rwm
set of options each--device
flagnote:
--device
cannot safely used ephemeral devices. block devices may removed should not added untrusted containers--device
.
as seen in issue 10637, devices can change node names. see issue 8826
if launch docker daemon
lxc
backend, should able use--lxc-conf=lxc.cgroup.devices.allow = c 189:* rwm
allow container access devices of group, , usevolume -v /dev/bus/usb/:/dev/bus/usb/
access all usb devices.
Comments
Post a Comment