- I installed Ubuntu in a docker container
docker run -it --privileged -u root --name ubuntu-vm ubuntu /bin/bash
- Installed docker in Ubuntu according to the official instructions
https://docs.docker.com/engine/install/ubuntu/
- Next command
sudo service docker start
starts docker, but i got message
root@41f5384a6b58:/# sudo service docker start
mount: /sys/fs/cgroup/cpuset: permission denied.
mount: /sys/fs/cgroup/cpu: permission denied.
mount: /sys/fs/cgroup/cpuacct: permission denied.
mount: /sys/fs/cgroup/blkio: permission denied.
mount: /sys/fs/cgroup/memory: permission denied.
mount: /sys/fs/cgroup/devices: permission denied.
mount: /sys/fs/cgroup/freezer: permission denied.
mount: /sys/fs/cgroup/net_cls: permission denied.
mount: /sys/fs/cgroup/perf_event: permission denied.
mount: /sys/fs/cgroup/net_prio: permission denied.
mount: /sys/fs/cgroup/hugetlb: permission denied.
mount: /sys/fs/cgroup/pids: permission denied.
mount: /sys/fs/cgroup/rdma: permission denied.
* Starting Docker: docker
- After that i try to run docker compose up.
The build starts, but it looks like the build is taking forever. I can watch the size of the Ubuntu container grow, reach 59GB (allocated maximum), and of course I get an out-of-memory error (or similar). My docker compose should be around 1GB (not 59 or more).
It seems that the docker is not started by the root user, but by some other one, because the command сd sys/fs/cgroup/cpuset (сd sys/fs/cgroup/...) or for another similar directory works.
command
sudo usermod -aG docker root
did not solve the problem
How can I solve the problem from point 3?
I am trying to use Ubuntu in a container, so that it is convenient and quick to determine the resources (memory, ram etc.) required for my server to work.