본문 바로가기
IT-개발,DB

docker container stop 안될 때 또는 docker-compose down 안될 때

by SB리치퍼슨 2021. 3. 1.

docker container stop 안될 때 또는 docker-compose down 안될 때

 

시스템관리자가 해줘야 할 일:  AppArmor가 일을 똑바로 안해서 발생;

docker 설치 후 발생 할 수 있는 문제

$ docker stop python

Error response from daemon: cannot stop container: python: Cannot kill container c2ea9333f97082d88578268f269657aa43e12d7b561b3503a64aa8b4738ee98a: unknown error after kill: runc did not terminate sucessfully: container_linux.go:392: signaling init process caused "permission denied"
: unknown


아래는 해결책

# For anyone that does not wish to completely purge AppArmor.
# Check status:
$ sudo aa-status

# Shutdown and prevent it from restarting:
$ sudo systemctl disable apparmor.service --now

Synchronizing state of apparmor.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable apparmor

# Unload AppArmor profiles:
$ sudo service apparmor teardown

 * Unloading AppArmor profiles


# Check status:
$ sudo aa-status
# You should now be able to stop/kill containers.

apparmor module is loaded.
0 profiles are loaded.
0 profiles are in enforce mode.
0 profiles are in complain mode.
0 processes have profiles defined.
0 processes are in enforce mode.
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.

# 이제 명령어 권한이 동작함
$ docker stop python

 
반응형

'IT-개발,DB' 카테고리의 다른 글

파이썬 가상환경 설정 (아주 간단해요)  (0) 2021.03.02
Mac에서 MariaDB 설치  (0) 2021.03.02
python 가이드 자동생성  (0) 2021.02.27
python django Testing  (0) 2021.02.27
python 문자열 변환  (0) 2021.02.25

댓글