OpenVZ Forum


Home » General » Discussions » Docker into OpenVZ container
Docker into OpenVZ container [message #52060] Thu, 21 May 2015 08:35 Go to next message
wiuempe is currently offline  wiuempe
Messages: 1
Registered: May 2015
Junior Member
From: *assecobs.pl
Hello, i want to setup docker into openvz container with this howto: wiki.openvz.org/Docker_inside_CT . When i trying to run docker service, i have message about error in mounts:

docker:~# bash -x /etc/init.d/docker start   
+ set -e
+ export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
+ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
++ basename /etc/init.d/docker
+ BASE=docker
+ DOCKER=/usr/bin/docker
+ DOCKER_PIDFILE=/var/run/docker.pid
+ DOCKER_SSD_PIDFILE=/var/run/docker-ssd.pid
+ DOCKER_LOGFILE=/var/log/docker.log
+ DOCKER_OPTS=
+ DOCKER_DESC=Docker
+ . /lib/lsb/init-functions
+++ run-parts --lsbsysinit --list /lib/lsb/init-functions.d
++ for hook in '$(run-parts --lsbsysinit --list /lib/lsb/init-functions.d 2>/dev/null)'
++ '[' -r /lib/lsb/init-functions.d/20-left-info-blocks ']'
++ . /lib/lsb/init-functions.d/20-left-info-blocks
++ FANCYTTY=
++ '[' -e /etc/lsb-base-logging.sh ']'
++ true
+ '[' -f /etc/default/docker ']'
+ . /etc/default/docker
+ '[' -x /sbin/initctl ']'
+ '[' '!' -x /usr/bin/docker ']'
+ case "$1" in
+ fail_unless_root
++ id -u
+ '[' 0 '!=' 0 ']'
+ cgroupfs_mount
+ grep -v '^#' /etc/fstab
+ grep -q cgroup
+ '[' '!' -e /proc/cgroups ']'
+ '[' '!' -d /sys/fs/cgroup ']'
+ mountpoint -q /sys/fs/cgroup
+ cd /sys/fs/cgroup
++ awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups
+ for sys in '$(awk '\''!/^#/ { if ($4 == 1) print $1 }'\'' /proc/cgroups)'
+ mkdir -p cpuset
+ mountpoint -q cpuset
+ mount -n -t cgroup -o cpuset cgroup cpuset
mount: wrong fs type, bad option, bad superblock on cgroup,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

+ rmdir cpuset
+ for sys in '$(awk '\''!/^#/ { if ($4 == 1) print $1 }'\'' /proc/cgroups)'
+ mkdir -p cpu
+ mountpoint -q cpu
+ mount -n -t cgroup -o cpu cgroup cpu
mount: wrong fs type, bad option, bad superblock on cgroup,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

+ rmdir cpu
+ for sys in '$(awk '\''!/^#/ { if ($4 == 1) print $1 }'\'' /proc/cgroups)'
+ mkdir -p cpuacct
+ mountpoint -q cpuacct
+ mount -n -t cgroup -o cpuacct cgroup cpuacct
mount: wrong fs type, bad option, bad superblock on cgroup,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

+ rmdir cpuacct
+ for sys in '$(awk '\''!/^#/ { if ($4 == 1) print $1 }'\'' /proc/cgroups)'
+ mkdir -p devices
+ mountpoint -q devices
+ mount -n -t cgroup -o devices cgroup devices
mount: wrong fs type, bad option, bad superblock on cgroup,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

+ rmdir devices
+ for sys in '$(awk '\''!/^#/ { if ($4 == 1) print $1 }'\'' /proc/cgroups)'
+ mkdir -p freezer
+ mountpoint -q freezer
+ mount -n -t cgroup -o freezer cgroup freezer
mount: wrong fs type, bad option, bad superblock on cgroup,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

+ rmdir freezer
+ for sys in '$(awk '\''!/^#/ { if ($4 == 1) print $1 }'\'' /proc/cgroups)'
+ mkdir -p net_cls
+ mountpoint -q net_cls
+ mount -n -t cgroup -o net_cls cgroup net_cls
mount: wrong fs type, bad option, bad superblock on cgroup,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

+ rmdir net_cls
+ for sys in '$(awk '\''!/^#/ { if ($4 == 1) print $1 }'\'' /proc/cgroups)'
+ mkdir -p blkio
+ mountpoint -q blkio
+ for sys in '$(awk '\''!/^#/ { if ($4 == 1) print $1 }'\'' /proc/cgroups)'
+ mkdir -p perf_event
+ mountpoint -q perf_event
+ mount -n -t cgroup -o perf_event cgroup perf_event
mount: wrong fs type, bad option, bad superblock on cgroup,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

+ rmdir perf_event
+ for sys in '$(awk '\''!/^#/ { if ($4 == 1) print $1 }'\'' /proc/cgroups)'
+ mkdir -p net_prio
+ mountpoint -q net_prio
+ mount -n -t cgroup -o net_prio cgroup net_prio
mount: wrong fs type, bad option, bad superblock on cgroup,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

+ rmdir net_prio
+ for sys in '$(awk '\''!/^#/ { if ($4 == 1) print $1 }'\'' /proc/cgroups)'
+ mkdir -p memory
+ mountpoint -q memory
+ touch /var/log/docker.log
+ chgrp docker /var/log/docker.log
+ ulimit -n 1048576
+ '[' /bin/bash ']'
+ ulimit -u 1048576
+ log_begin_msg 'Starting Docker: docker'
+ log_begin_msg_pre 'Starting Docker: docker'
+ log_daemon_msg_pre 'Starting Docker: docker'
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ '[' -t 1 ']'
+ '[' xxterm '!=' x ']'
+ '[' xxterm '!=' xdumb ']'
+ '[' -x /usr/bin/tput ']'
+ '[' -x /usr/bin/expr ']'
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ '[' -z ']'
+ FANCYTTY=1
+ case "$FANCYTTY" in
+ true
+ /bin/echo -n '[....] '
[....] + '[' -z 'Starting Docker: docker' ']'
+ /bin/echo -n 'Starting Docker: docker'
Starting Docker: docker+ log_begin_msg_post 'Starting Docker: docker'
+ :
+ start-stop-daemon --start --background --no-close --exec /usr/bin/docker --pidfile /var/run/docker-ssd.pid --make-pidfile -- -d -p /var/run/docker.pid
+ log_end_msg 0
+ '[' -z 0 ']'
+ local retval
+ retval=0
+ log_end_msg_pre 0
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ '[' -t 1 ']'
+ '[' xxterm '!=' x ']'
+ '[' xxterm '!=' xdumb ']'
+ '[' -x /usr/bin/tput ']'
+ '[' -x /usr/bin/expr ']'
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ '[' -z 1 ']'
+ true
+ case "$FANCYTTY" in
+ true
++ /usr/bin/tput setaf 1
+ RED=''
++ /usr/bin/tput setaf 2
+ GREEN=''
++ /usr/bin/tput setaf 3
+ YELLOW=''
++ /usr/bin/tput op
+ NORMAL=''
+ /usr/bin/tput civis
+ /usr/bin/tput sc
+ /usr/bin/tput hpa 0
+ '[' 0 -eq 0 ']'
+ /bin/echo -ne '[ ok '
[ ok + /usr/bin/tput rc
+ /usr/bin/tput cnorm
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ '[' -t 1 ']'
+ '[' xxterm '!=' x ']'
+ '[' xxterm '!=' xdumb ']'
+ '[' -x /usr/bin/tput ']'
+ '[' -x /usr/bin/expr ']'
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ '[' -z 1 ']'
+ true
+ case "$FANCYTTY" in
+ true
++ /usr/bin/tput setaf 1
+ RED=''
++ /usr/bin/tput setaf 3
+ YELLOW=''
++ /usr/bin/tput op
+ NORMAL=''
+ '[' 0 -eq 0 ']'
+ echo .
.
+ log_end_msg_post 0
+ :
+ return 0

When i trying to run docker, i have:
docker:~# docker -D run ubuntu:14.04 /bin/echo 'Hello world'
DEBU[0010] Corrupted prefix: []                         
DEBU[0010] [hijack] End of stdout                       
DEBU[0010] End of CmdRun(), Waiting for hijack to finish. 
FATA[0010] Error response from daemon: Cannot start container 37334e43a8384e845594f16e3b76a3d0c4153cd91a24e9c7806a5ac80db44696: [8] System error: mountpoint for cpu not found


I found this error is when docker havent cgroup for cpu, so i trying mount cpu cgroup support on host, but i cannot:

root@lubtest03:~# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=4115565,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=3294292k,mode=755)
/dev/mapper/s-root on / type xfs (rw,relatime,attr2,delaylog,noquota)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=8266300k)
/dev/mapper/s-docker on /fs/v/docker type xfs (rw,relatime,attr2,delaylog,noquota)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
beancounter on /proc/vz/beancounter type cgroup (rw,relatime,blkio,name=beancounter)
container on /proc/vz/container type cgroup (rw,relatime,freezer,devices,name=container)
fairsched on /proc/vz/fairsched type cgroup (rw,relatime,cpuacct,cpu,cpuset,name=fairsched)
/fs/v/docker/private on /fs/v/docker/root type simfs (rw,relatime)
proc on /fs/v/docker/root/proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /fs/v/docker/root/sys type sysfs (rw,nosuid,nodev,noexec,relatime)
cgroup on /fs/v/docker/root/sys/fs/cgroup type tmpfs (rw,relatime)
tmpfs on /fs/v/docker/root/var/run type tmpfs (rw,nosuid,noexec,relatime)
tmpfs on /fs/v/docker/root/var/run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /fs/v/docker/root/var/run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
devpts o
...

Re: Docker into OpenVZ container [message #52093 is a reply to message #52060] Fri, 19 June 2015 19:41 Go to previous messageGo to next message
tburazin is currently offline  tburazin
Messages: 6
Registered: June 2015
Junior Member
From: 188.252.201*
Hi wiuempe,
I've been successful in getting Docker to run, but only on the following configuration:
CentOS (6 or 7 with kernel 2.6.32-042stab108.2) host server with running a CentOS 7 container running Docker.

The how-to on wiki.openvz.org/Docker_inside_CT works perfectly for my configuration. Except Docker uses up all inodes REALY fast so I'm still working on an optimal number for that.


blog.codeanywhere.com/tag/tommy-burazin
Re: Docker into OpenVZ container [message #52355 is a reply to message #52093] Tue, 15 March 2016 22:55 Go to previous messageGo to next message
locara is currently offline  locara
Messages: 4
Registered: March 2016
Junior Member
From: *92.62.81.dynamic.wline.res.cust.swisscom.ch
hello,
i have the same issue but with centos 7 it did not work i have on start container this Error:
CT-55555 /# docker start 12ed179e86a8
Error response from daemon: Cannot start container 12ed179e86a8: [8] System error: write /sys/fs/cgroup/cpuset/system.slice/docker-12ed179e86a8c5253e 8b02d1f21edd82cb443a48575471a3654f55578323282f.scope/cgroup. procs: no space left on device
Error: failed to start containers: [12ed179e86a8]

Handler for POST /containers/{name:.*}/start returned error: Cannot start container 12ed179e86a8: [8] System error: write /sys/fs/cgroup/cpuset/system.slice/docker-12ed179e86a8c5253e 8b02d1f21edd82cb443a48575471a3654f55578323282f.scope/cgroup. procs: no space left on device
ERRO[1198] HTTP Error err=Cannot start container 12ed179e86a8: [8] System error: write /sys/fs/cgroup/cpuset/system.slice/docker-12ed179e86a8c5253e 8b02d1f21edd82cb443a48575471a3654f55578323282f.scope/cgroup. procs: no space left on device statusCode=500

I thin docker an Virtuozzo does work together. This is not was Marketing said.
Re: Docker into OpenVZ container [message #52362 is a reply to message #52060] Wed, 23 March 2016 13:19 Go to previous messageGo to next message
Ales is currently offline  Ales
Messages: 326
Registered: May 2009
Senior Member
From: *dynamic.sbb.rs
So how many inodes did you assign to your VM?
Re: Docker into OpenVZ container [message #52363 is a reply to message #52362] Wed, 23 March 2016 13:28 Go to previous messageGo to next message
locara is currently offline  locara
Messages: 4
Registered: March 2016
Junior Member
From: *17.62.81.dynamic.wline.res.cust.swisscom.ch
Hallo,

Thank for answer, i use one namenöde an two Datenode. But the issue is exactly i iwant to run the Container.
Re: Docker into OpenVZ container [message #52367 is a reply to message #52060] Sat, 26 March 2016 21:25 Go to previous messageGo to next message
Ales is currently offline  Ales
Messages: 326
Registered: May 2009
Senior Member
From: *dynamic.sbb.rs
I think you misunderstood me. The "inode" is a very specific filesystem term. The amount of inodes is something you set for each container.

I haven't used docker and openvz together, but I see tburazin mentioning large demand for inodes due to docker. The lack of inodes could quite possibly translate into device space errors so I would advise you to check how much inodes have you assigned to a container running docker and try assigning more.
Re: Docker into OpenVZ container [message #52368 is a reply to message #52367] Sun, 27 March 2016 06:47 Go to previous messageGo to next message
locara is currently offline  locara
Messages: 4
Registered: March 2016
Junior Member
From: *253.62.81.dynamic.wline.res.cust.swisscom.ch
Thanks verry much,

Where can i change this terms, in openVZ container?
Re: Docker into OpenVZ container [message #52369 is a reply to message #52368] Sun, 27 March 2016 09:31 Go to previous message
tburazin is currently offline  tburazin
Messages: 6
Registered: June 2015
Junior Member
From: 188.252.221*
Hi locara,
the number of inodes is set per container. If you are experiencing a shortage of inodes you can check with the command:
vzctl exec CTID df -i

You can find some explanation regarding disk quotas here: https://openvz.org/Resource_shortage#Disk_quota
The command to change number of inodes is:
vzctl set CTID --diskinodes softlimit:hardlimit --save
eg:
vzctl set 101 --diskinodes 5000000:5500000 --save

The default size is 2000000:2200000 if I remember correctly and it's recommended to allocate 200000 inodes per GB hard drive (for softlimit) and 220000 inodes per GB hard drive (hardlimit)

You can go with a different amount, but be careful not to use up all your inodes on one container.



blog.codeanywhere.com/tag/tommy-burazin
Previous Topic: full filesystem
Next Topic: openvz kernel error
Goto Forum:
  


Current Time: Sat Oct 21 17:51:49 GMT 2017