升級docker images, 舊版images變成none
最近升級moodle到4.0.1版本, 發現有問題, 想用回舊版, 發現舊版的變成 moodle:<none> , 這樣一來不就不能使用舊版了, 後來發現只要知道舊版images id , 就可以改成想要的tag, 也就能繼續使用了
docker tag <images id> <images name>:x.x
docker tag 43b9473f010d bitnami/moodle:3.10
最近升級moodle到4.0.1版本, 發現有問題, 想用回舊版, 發現舊版的變成 moodle:<none> , 這樣一來不就不能使用舊版了, 後來發現只要知道舊版images id , 就可以改成想要的tag, 也就能繼續使用了
docker tag <images id> <images name>:x.x
docker tag 43b9473f010d bitnami/moodle:3.10
先前寫了一篇centos7安裝opendkim+postfix 這只是單一網域, 若要多個網域,實在是很麻煩
google爬文爬到一篇文章,有神人寫了自動產生相關文件的shell script , 我稍微修改一下, 就能很方便產生相關文件.
#centos 7
yum install opendkim
#centos 8 , rocky linux 8
yum install opendkim opendkim-tools
一直以來我都讓postfix使用 sasl 方式處裡寄信認證, 但是連結到多網域主控伺服器的時候, 就會出錯, 很麻煩.
經過測試 dovecot 可以使用多組 userdb , 與passdb , 達到一個mail server 支援多個ldap網域主控.
當然也能省下一個sasl的service
service auth {
...
unix_listener /var/spool/postfix/private/auth {
mode = 0660
# Assuming the default Postfix user and group
user = postfix
group = postfix
}
...
}
#以下設定為了相容outlook系統
auth_mechanisms = plain login
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
# On Debian Wheezy path must be relative and queue_directory defined
#queue_directory = /var/spool/postfix
# and the common settings to enable SASL:
smtpd_sasl_auth_enable = yes
submission inet n - n - - smtpd
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_sasl_type=dovecot
-o smtpd_sasl_path=private/auth
-o smtpd_sasl_security_options=noanonymous
-o smtpd_sasl_local_domain=$myhostname
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o smtpd_sender_login_maps=hash:/etc/postfix/virtual
-o smtpd_sender_restrictions=reject_sender_login_mismatch
...
參考:
https://doc.dovecot.org/configuration_manual/howto/postfix_and_dovecot_sasl/
除非有log備份需要, 否則log太大, 必須抓出來, 然後清 0 (cat /dev/null > xxx.log)
find /docker/images/ -name *.log -ls | sort -r -n -k7
或是
find /docker/images/ -name *.log -type f -size +1000000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro assaflavie/runlike <容器名稱>
docker run --rm -i -v /var/run/docker.sock:/var/run/docker.sock nexdrew/rekcod <容器名稱>
但是這種方式屬於 reverse 方式, 跟原本會有一些失真,但真的沒留下當初執行的指令, 也只好使用這種方式了
https://apps.nextcloud.com/apps/onlyoffice/releases?platform=14
避免與不相容的版本起衝突
目前2022/5/13 我升級到nextcloud 22.2.7 , 但因為docker上面的onlyoffice 最新的是7.1.0,
onlyoffice 只有支援7.2以上才支援 nextcloud 23 , 所以我就無法升級到nextcloud 23囉
'trusted_proxies' =>
array (
0 => '反向代理server的host ip',
1 => 'docker local ip',
),
'trusted_proxies' => array ( 0 => 'x.x.x.x', 1 => '172.0.0.1/8', ),
修改 config.php
過了31天清除
'trashbin_retention_obligation' => 'auto,31',
'versions_retention_obligation' => 'auto,31',
若使用docker安裝, 建議停用容器內建的排程, 改用外面主機, 設定排程自行刪除垃圾桶
# 停用背景排程
docker exec -t -u www-data <container> php occ config:app:set --value=no files_trashbin background_job_expire_trash
docker exec -t -u www-data nextcloud php occ config:app:set --value=no files_versions background_job_expire_versions
# 停用容器內建排程後,改用外面主機定期清除
docker exec -t -u www-data <container> php occ trashbin:expire --quiet
docker run restic/restic 參數
## 例如
docker run restic/restic version
#例如建立repository
docker run -v /root:/root restic/restic --repo /root/repo --password-file=/root/password init
export GODEBUG=asyncpreemptoff=1
docker run -v /root:/root restic/restic --repo /root/repo --password-file=/root/password backup /root/a
現在安裝docker 跟喝水一樣, 完全沒難度阿
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
dnf update -y
dnf install -y docker-ce docker-ce-cli containerd.io
docker --version
#########
#ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecStart=/usr/bin/dockerd --data-root /docker -H fd:// --containerd=/run/containerd/containerd.sock
#########
systemctl daemon-reload
systemctl enable docker
systemctl start docker
docker ps