update some content

This commit is contained in:
2021-10-28 14:15:01 +08:00
parent b8600ab259
commit 27b5a11382
163 changed files with 951 additions and 922 deletions

View File

@@ -45,9 +45,9 @@
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link href="https://h.cowbay.org/css/style.css?v=1634607506" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
<link href="https://h.cowbay.org/css/style.css?v=1635401692" rel="stylesheet" id="theme-stylesheet" type='text/css' media='all'>
<link href="https://h.cowbay.org/css/custom.css?v=1634607506" rel="stylesheet" type='text/css' media='all'>
<link href="https://h.cowbay.org/css/custom.css?v=1635401692" rel="stylesheet" type='text/css' media='all'>
<link rel="shortcut icon" href="https://h.cowbay.org/img/favicon.ico" type="image/x-icon">
<link rel="icon" href="https://h.cowbay.org/img/favicon.ico" type="image/x-icon">
@@ -313,7 +313,7 @@ if (!doNotTrack) {
<p>本來看了這篇 <a href="https://www.arthurtoday.com/2016/07/how-to-setup-docker-container-timezone-host.html">https://www.arthurtoday.com/2016/07/how-to-setup-docker-container-timezone-host.html</a></p>
<p>想說來試試看好了</p>
<p>不過呢一開始依照這篇的說明在docker-compose.yml 內加入</p>
<pre tabindex="0"><code>web:
<pre><code>web:
image: jarischaefer/docker-librenms
hostname: librenms
ports:
@@ -326,13 +326,13 @@ if (!doNotTrack) {
- TZ=&quot;Asia/Taipei&quot;
</code></pre><p>重起之後沒作用 0rz</p>
<p>於是我又加入了</p>
<pre tabindex="0"><code> volumes:
<pre><code> volumes:
- /etc/hosts:/etc/hosts
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
</code></pre><p>結果啟動直接報錯誤了..</p>
<p>看一下 log</p>
<pre tabindex="0"><code>May 21 09:09:12 bbs012 syslog-ng[12]: syslog-ng starting up; version='3.13.2'
<pre><code>May 21 09:09:12 bbs012 syslog-ng[12]: syslog-ng starting up; version='3.13.2'
*** Running /etc/my_init.d/librenms_100_cron...
*** Running /etc/my_init.d/librenms_101_ssl...
*** Running /etc/my_init.d/librenms_102_ipv6...
@@ -343,7 +343,7 @@ if (!doNotTrack) {
*** Killing all processes...
</code></pre><p>所以這個檔案不能改成 ro 不過如果不能唯獨那啟動docker的時候應該會被蓋掉吧</p>
<p>先來看一下那個 librenms_103_timezone 在幹什麼好了</p>
<pre tabindex="0"><code>docker exec -it librenms_web_1 cat /etc/my_init.d/librenms_103_timezone
<pre><code>docker exec -it librenms_web_1 cat /etc/my_init.d/librenms_103_timezone
#!/bin/bash -e
if [ -n &quot;$TZ&quot; ]; then
@@ -361,23 +361,23 @@ fi
</code></pre><p>OK ,這裡的確是用傳進來的 $TZ 在設定timezone 沒錯</p>
<p>可是我前面已經改過 docker-compose.yml</p>
<p>有把 TZ帶進來了啊再來確認一下</p>
<pre tabindex="0"><code>docker exec -it librenms_web_1 cat /etc/timezone
<pre><code>docker exec -it librenms_web_1 cat /etc/timezone
&quot;Asia/Taipei&quot;
</code></pre><p>咦,沒錯啊? 欸斗,等等,那兩個 &quot;&quot; 有點刺眼&hellip;</p>
<p>跟本機的比對一下看看</p>
<pre tabindex="0"><code>2019-05-21 17:36:20 [mini@s013 librenms]$ docker exec -it librenms_web_1 cat /etc/timezone
<pre><code>2019-05-21 17:36:20 [mini@s013 librenms]$ docker exec -it librenms_web_1 cat /etc/timezone
&quot;Asia/Taipei&quot;
2019-05-21 17:36:23 [mini@s013 librenms]$ cat /etc/timezone
Asia/Taipei
2019-05-21 17:37:10 [mini@s013 librenms]$
</code></pre><p>嗯,的確,本機的格式的確不包含那兩個 &quot;&quot;</p>
<p>那就改掉再來試試看吧&hellip;改成底下這樣</p>
<pre tabindex="0"><code> environment:
<pre><code> environment:
- TZ=Asia/Taipei
</code></pre><p>重起 docker ,然後確認時間看看</p>
<pre tabindex="0"><code>2019-05-21 17:39:00 [mini@s013 librenms]$ docker-compose down;docker-compose up -d
<pre><code>2019-05-21 17:39:00 [mini@s013 librenms]$ docker-compose down;docker-compose up -d
Stopping librenms_web_1 ... done
Stopping librenms_mysql_1 ... done
Removing librenms_web_1 ... done
@@ -681,7 +681,7 @@ title="pinterest icon"></i>
</div>
<script src="https://h.cowbay.org/js/jquery.min.js"></script>
<script src="https://h.cowbay.org/js/jquerymigrate.js"></script>
<script src="https://h.cowbay.org/js/production.min.js?v=1634607506"></script>
<script src="https://h.cowbay.org/js/production.min.js?v=1635401692"></script>
</body>
</html>