Obsidian/Recognition/Programing/Docker/Docker 서비스 등록.md

642 B

  • SELinux 종료해아함
# Selinux 상태확인
getenforce
	-> Enforcing # 실행중인 상태임

nano /etc/sysconfig/selinux
	SELINUX=disabled

setenforce 0
getenforce
	-> Permissive # 종료상태
  • docker 데몬 종료

ps -ef | grep docker

kill -9 PID
 
  • 데몬 서비스 등록

nano /etc/systemd/system/docker.service

[Unit]
Description=Systemd Docker Daemon

[Service]
Type=simple
ExecStart=dockerd --data-root=/home/gmt/docker_data
Restart=on-failure

[Install]
WantedBy=multi-user.target



systemctl daemon-reload
systemctl enable docker
systemctl start docker
systemctl status docker