2026-11-14 09:14:57
This commit is contained in:
1 parent
e0928dac6f
commit
c56ae9b7a8
1 file changed
-49
@@ -1,49 +0,0 @@
|
|||||||
Install Docker
|
|
||||||
--------------
|
|
||||||
|
|
||||||
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
|
|
||||||
dnf install -y docker-ce --nobest
|
|
||||||
|
|
||||||
systemctl enable --now docker
|
|
||||||
systemctl status docker
|
|
||||||
|
|
||||||
|
|
||||||
Docker is installed by default on `/var/lib/docker`. To move it on other file system, for example `/app/docker`:
|
|
||||||
|
|
||||||
systemctl stop docker
|
|
||||||
|
|
||||||
cd /var/lib/
|
|
||||||
mv docker /app/
|
|
||||||
ln -s /app/docker .
|
|
||||||
|
|
||||||
systemctl start docker
|
|
||||||
systemctl status docker
|
|
||||||
|
|
||||||
Usefull commands
|
|
||||||
----------------
|
|
||||||
|
|
||||||
Alias to stop and remove all containers:
|
|
||||||
|
|
||||||
alias cclean='docker stop $(docker ps -a -q); docker rm $(docker ps -a -q)'
|
|
||||||
|
|
||||||
Truncate all container logs:
|
|
||||||
|
|
||||||
truncate -s 0 $(docker inspect --format='{{.LogPath}}' $(docker ps -a -q))
|
|
||||||
|
|
||||||
Save an image:
|
|
||||||
|
|
||||||
docker save sabnzbd/sabnzbd | pigz > /mnt/yavin4/tmp/sabnzbd.tar.gz
|
|
||||||
|
|
||||||
Load an image:
|
|
||||||
|
|
||||||
gunzip -c /mnt/yavin4/tmp/sabnzbd.tar.gz | docker load
|
|
||||||
|
|
||||||
Set auto start for all host containers:
|
|
||||||
|
|
||||||
docker update --restart unless-stopped $(docker ps -q)
|
|
||||||
|
|
||||||
Run command in bash:
|
|
||||||
|
|
||||||
docker exec -it <container> bash
|
|
||||||
|
|
||||||
|
|
||||||
Reference in new issue
Block a user