[SOLVED] issue to install docker in ubuntu lxc

stipe

New Member
Feb 7, 2021
8
0
1
36
Hi all,

I would like to install docker in LXC but I still have this error in end of the installation (ubuntu or debian...):

Code:
[...]
TriggeredBy: * docker.socket
       Docs: https://docs.docker.com
    Process: 11536 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 11536 (code=exited, status=1/FAILURE)
dpkg: error processing package docker-ce (--configure):
 installed docker-ce package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of docker-ce-rootless-extras:
 docker-ce-rootless-extras depends on docker-ce; however:
  Package docker-ce is not configured yet.

dpkg: error processing package docker-ce-rootless-extras (--configure):
 dependency problems - leaving unconfigured
Setting up liberror-perl (0.17029-1) ...
Setting up git (1:2.27.0-1ubuntu1) ...
Processing triggers for systemd (246.6-1ubuntu1.1) ...
Processing triggers for man-db (2.9.3-2) ...
Processing triggers for libc-bin (2.32-0ubuntu3) ...
Errors were encountered while processing:
 docker-ce
 docker-ce-rootless-extras
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@DockerLXC:~# sudo systemctl status docker
* docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2021-02-09 22:49:47 UTC; 46s ago
TriggeredBy: * docker.socket
       Docs: https://docs.docker.com
    Process: 13407 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 13407 (code=exited, status=1/FAILURE)

Feb 09 22:49:47 DockerLXC systemd[1]: docker.service: Scheduled restart job, restart counter is at 4.
Feb 09 22:49:47 DockerLXC systemd[1]: Stopped Docker Application Container Engine.
Feb 09 22:49:47 DockerLXC systemd[1]: docker.service: Start request repeated too quickly.
Feb 09 22:49:47 DockerLXC systemd[1]: docker.service: Failed with result 'exit-code'.
Feb 09 22:49:47 DockerLXC systemd[1]: Failed to start Docker Application Container Engine.

someone to refer me?
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
3,155
364
88
hi,

you need to activate the nesting feature for docker to work:
nesting=<boolean> (default = 0)
Allow nesting. Best used with unprivileged containers with additional id mapping. Note that this will expose procfs and sysfs contents of the host to the guest.

you can enable it in the GUI: Container -> Options -> Features -> Nesting
 

stipe

New Member
Feb 7, 2021
8
0
1
36
hi,

you need to activate the nesting feature for docker to work:


you can enable it in the GUI: Container -> Options -> Features -> Nesting
Hi Oguz,

Thanks but the problem is that Nesting was already checked
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
3,155
364
88
with an ubuntu 20.04 container and nesting activated (change 123 with your container's id):

Code:
pve# pct enter 123
CT# apt update && apt dist-upgrade -y
CT# exit
pve# pct reboot 123
pve# pct enter 123
CT# apt install docker.io
CT# systemctl start docker
CT# docker run -it --entrypoint "/bin/bash" ubuntu:latest

and it should work.
 

stipe

New Member
Feb 7, 2021
8
0
1
36
with an ubuntu 20.04 container and nesting activated (change 123 with your container's id):

Code:
pve# pct enter 123
CT# apt update && apt dist-upgrade -y
CT# exit
pve# pct reboot 123
pve# pct enter 123
CT# apt install docker.io
CT# systemctl start docker
CT# docker run -it --entrypoint "/bin/bash" ubuntu:latest

and it should work.
I just created a new LXC CT and followed your instructions:

Code:
root@Docker:~# systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
root@Docker:~#
root@Docker:~#
root@Docker:~# journalctl -xe
-- Support: http://www.ubuntu.com/support
--
-- A stop job for unit docker.socket has begun execution.
--
-- The job identifier is 584.
Feb 10 15:00:38 Docker systemd[1]: Starting Docker Socket for the API.
-- Subject: A start job for unit docker.socket has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit docker.socket has begun execution.
--
-- The job identifier is 584.
Feb 10 15:00:38 Docker systemd[1]: Listening on Docker Socket for the API.
-- Subject: A start job for unit docker.socket has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit docker.socket has finished successfully.
--
-- The job identifier is 584.
Feb 10 15:00:38 Docker systemd[1]: docker.service: Start request repeated too quickly.
Feb 10 15:00:38 Docker systemd[1]: docker.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit docker.service has entered the 'failed' state with result 'exit-code'.
Feb 10 15:00:38 Docker systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: A start job for unit docker.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit docker.service has finished with a failure.
--
-- The job identifier is 531 and the job result is failed.
Feb 10 15:00:38 Docker systemd[1]: docker.socket: Failed with result 'service-start-limit-hit'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit docker.socket has entered the 'failed' state with result 'service-start-limit-hit'.
lines 3574-3615/3615 (END)
root@Docker:~#
root@Docker:~#
root@Docker:~# dockerd
INFO[2021-02-10T15:02:15.224081848Z] Starting up                                 
ERRO[2021-02-10T15:02:15.244079400Z] AppArmor enabled on system but the docker-default profile could not be loaded: running `/sbin/apparmor_parser apparmor_parser -Kr /var/lib/docker/tmp/docker-default299986007` failed with output: apparmor_parser: Unable to replace "docker-default".  Permission denied; attempted to load a profile while confined?

error: exit status 243

Still not work...
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
3,155
364
88
do you have the latest packages installed? can you post pveversion -v ? maybe you have to update your machine
 

stipe

New Member
Feb 7, 2021
8
0
1
36
do you have the latest packages installed? can you post pveversion -v ? maybe you have to update your machine
Code:
root@proxmox:~# pveversion -v
proxmox-ve: 6.3-1 (running kernel: 5.4.78-2-pve)
pve-manager: 6.3-3 (running version: 6.3-3/eee5f901)
pve-kernel-5.4: 6.3-3
pve-kernel-helper: 6.3-3
pve-kernel-5.4.78-2-pve: 5.4.78-2
pve-kernel-5.4.73-1-pve: 5.4.73-1
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.4-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
ksm-control-daemon: 1.3-1
libjs-extjs: 6.0.1-10
libknet1: 1.16-pve1
libproxmox-acme-perl: 1.0.7
libproxmox-backup-qemu0: 1.0.2-1
libpve-access-control: 6.1-3
libpve-apiclient-perl: 3.1-3
libpve-common-perl: 6.3-2
libpve-guest-common-perl: 3.1-4
libpve-http-server-perl: 3.1-1
libpve-storage-perl: 6.3-5
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 4.0.6-1
lxcfs: 4.0.6-pve1
novnc-pve: 1.1.0-1
proxmox-backup-client: 1.0.6-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.4-4
pve-cluster: 6.2-1
pve-container: 3.3-2
pve-docs: 6.3-1
pve-edk2-firmware: 2.20200531-1
pve-firewall: 4.1-3
pve-firmware: 3.1-3
pve-ha-manager: 3.1-1
pve-i18n: 2.2-2
pve-qemu-kvm: 5.1.0-8
pve-xtermjs: 4.7.0-3
qemu-server: 6.3-3
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-2
zfsutils-linux: 0.8.5-pve1
root@proxmox:~#
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
3,155
364
88
lxc-pve: 4.0.6-1
you should install the 4.0.6-2 version from pve-no-subscription repository. if it's already configured then running apt update && apt dist-upgrade to fully update the system should do the trick. if you only want to update this package then you should instead run apt update && apt install lxc-pve
 
  • Like
Reactions: namelessx and stipe

stipe

New Member
Feb 7, 2021
8
0
1
36
you should install the 4.0.6-2 version from pve-no-subscription repository. if it's already configured then running apt update && apt dist-upgrade to fully update the system should do the trick. if you only want to update this package then you should instead run apt update && apt install lxc-pve
:D Yes! Now works like a charm! Thank you
 

oguz

Proxmox Staff Member
Staff member
Nov 19, 2018
3,155
364
88
great! please mark the thread as [SOLVED] so others know what to expect :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!