Docker(DinD) 프로세스 내에서 Docker를 호출하는 Python/Flask 애플리케이션(Docker)이 있지만 해당 호출이 발생하면 다음이 표시됩니다.
2023-07-07T02:21:28.733399366Z Traceback (most recent call last):
2023-07-07T02:21:28.733404074Z File "/home/meta/system/simulate.py", line 117, in simulate
2023-07-07T02:21:28.733408924Z job_container.start()
2023-07-07T02:21:28.733413666Z File "/usr/local/lib/python3.8/site-packages/docker/models/containers.py", line 404, in start
2023-07-07T02:21:28.733419036Z return self.client.api.start(self.id, **kwargs)
2023-07-07T02:21:28.733423792Z File "/usr/local/lib/python3.8/site-packages/docker/utils/decorators.py", line 19, in wrapped
2023-07-07T02:21:28.733428668Z return f(self, resource_id, *args, **kwargs)
2023-07-07T02:21:28.733433744Z File "/usr/local/lib/python3.8/site-packages/docker/api/container.py", line 1108, in start
2023-07-07T02:21:28.733438823Z self._raise_for_status(res)
2023-07-07T02:21:28.733443500Z File "/usr/local/lib/python3.8/site-packages/docker/api/client.py", line 261, in _raise_for_status
2023-07-07T02:21:28.733448503Z raise create_api_error_from_http_exception(e)
2023-07-07T02:21:28.733453223Z File "/usr/local/lib/python3.8/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
2023-07-07T02:21:28.733458407Z raise cls(e, response=response, explanation=explanation)
2023-07-07T02:21:28.733463125Z docker.errors.APIError: 500 Server Error: Internal Server Error ("cgroups: cgroup mountpoint does not exist: unknown")
다음을 통해 cgroup을 설정했습니다.
sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
echo "GRUB_CMDLINE_LINUX=systemd.unified_cgroup_hierarchy=false" | sudo tee /etc/default/grub.d/cgroup.cfg
sudo update-grub
을 실행하면 lxc-checkconfig <container-id>
다음을 얻습니다.
LXC version 5.0.0~git2209-g5a7b9ce67
Kernel configuration not found at /proc/config.gz; searching...
Kernel configuration found at /boot/config-5.19.0-1025-aws
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
--- Control groups ---
Cgroups: enabled
Cgroup namespace: enabled
Cgroup v1 mount points:
/sys/fs/cgroup/systemd
Cgroup v2 mount points:
/sys/fs/cgroup
Cgroup v1 freezer controller: missing
Cgroup v1 clone_children flag: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled
--- Misc ---
Veth pair device: enabled, loaded
Macvlan: enabled, not loaded
Vlan: enabled, not loaded
Bridges: enabled, loaded
Advanced netfilter: enabled, loaded
CONFIG_IP_NF_TARGET_MASQUERADE: enabled, not loaded
CONFIG_IP6_NF_TARGET_MASQUERADE: enabled, not loaded
CONFIG_NETFILTER_XT_TARGET_CHECKSUM: enabled, not loaded
CONFIG_NETFILTER_XT_MATCH_COMMENT: enabled, not loaded
FUSE (for use with lxcfs): enabled, not loaded
--- Checkpoint/Restore ---
checkpoint restore: enabled
CONFIG_FHANDLE: enabled
CONFIG_EVENTFD: enabled
CONFIG_EPOLL: enabled
CONFIG_UNIX_DIAG: enabled
CONFIG_INET_DIAG: enabled
CONFIG_PACKET_DIAG: enabled
CONFIG_NETLINK_DIAG: enabled
오류를 완화하기 위해 cgroup을 활성화하기 위해 누락된 구성에 대한 아이디어가 있습니까?
서버는 다음과 같습니다:
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy