Home » General » Discussions » Docker into OpenVZ container
Docker into OpenVZ container [message #52060] |
Thu, 21 May 2015 08:35 ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
wiuempe
Messages: 1 Registered: May 2015
|
Junior Member |
|
|
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 message Go to previous message](/theme/ovz3/images/up.png) ![Go to next message Go to next message](/theme/ovz3/images/down.png) |
tburazin
Messages: 6 Registered: June 2015
|
Junior Member |
|
|
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 #52369 is a reply to message #52368] |
Sun, 27 March 2016 09:31 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) |
tburazin
Messages: 6 Registered: June 2015
|
Junior Member |
|
|
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
|
|
|
Goto Forum:
Current Time: Tue Sep 03 21:45:13 GMT 2024
Total time taken to generate the page: 0.05167 seconds
|