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

51 lines
642 B
Markdown
Raw Normal View History

2023-08-14 16:19:25 +00:00
- SELinux 종료해아함
```bash
# Selinux 상태확인
getenforce
-> Enforcing # 실행중인 상태임
nano /etc/sysconfig/selinux
SELINUX=disabled
setenforce 0
getenforce
-> Permissive # 종료상태
```
- docker 데몬 종료
```bash
ps -ef | grep docker
kill -9 PID
```
- 데몬 서비스 등록
```bash
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
```