Failed to execute goal com.google.cloud.tools:jib-maven-plugin:1.1.2:dockerBuild (default-cli) on project xxxxx: Build to Docker daemon failed, perhaps you should use a registry that supports HTTPS so credentials can be sent safely, or set the 'sendCredentialsOverHttp' system property to true
docker run -it -name blog-auto-publish ubuntu:18.04 /bin/bash
apt update
apt install git
apt install vim
rm -rf /etc/apt/sources.list
vim /etc/apt/sources.list
script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
#!/usr/bin/env bash service fcgiwrap start service nginx start cd /my-blog/blog/ && nohup hexo g --watch >/my-blog/logs/hexo-generate.log 2>&1 & tail -f -n 500 /my-blog/logs/publish.log /my-blog/logs/hexo-generate.log /var/log/nginx/error.log /var/log/nginx/access.log
不使用 dockerfile 来构建,直接使用 docker commit
1
docker commit -c 'CMD ["sh", "/my-blog/bash/init.sh"]' -c "EXPOSE 80" -c "EXPOSE 8080" -a "JoyLau" -m "JoyLau's Blog Docker Image" blog nas.joylau.cn:5007/joy/blog.joylau.cn:2.1
优化更新记录 [2020-04-02]
更新脚本:
init.sh
1 2 3 4 5 6 7 8
#!/usr/bin/env bash echo"Hello! log file in /my-blog/logs/publish.log" service fcgiwrap start service nginx start su - www-data -c "cd /my-blog/blog/ && git pull" cd /my-blog/blog/ hexo g --watch | tee -a /my-blog/logs/publish.log
publish.sh
1 2 3 4 5
#!/bin/bash echo"Content-Type:text/html" echo"" echo"ok\r\n" /my-blog/bash/pull-deploy.sh | tee -a /my-blog/logs/publish.log
pull-deploy.sh
1 2 3 4 5
#! /usr/bin/env bash echo"Prepare to update Blog Posts....." cd /my-blog/blog/ git pull
优化更新记录 [2020-04-07]
新增 republish.sh
1 2 3 4
#!/usr/bin/env bash echo"prepare republish......" cd /my-blog/blog/ hexo clean && hexo g
修改 init.sh
1 2 3 4 5
#!/usr/bin/env bash echo"Hello! log file in /my-blog/logs/publish.log" service fcgiwrap start service nginx start su - www-data -c "cd /my-blog/blog/ && git pull && hexo g --watch | tee -a /my-blog/logs/publish.log"
#!/bin/bash set -e if [ "$1" = '/my-blog/bash/init.sh' -a "$(id -u)" = '0' ]; then service nginx start service fcgiwrap start echo"☆☆☆☆☆ base service has started. ☆☆☆☆☆" exec gosu www-data "$0""$@" fi exec"$@"
init.sh
1 2 3 4 5 6 7
#! /bin/bash cd /my-blog echo"☆☆☆☆☆ your git repo is [$GIT_REPO] ; branch is [$BRANCH]. ☆☆☆☆☆" git clone -b $BRANCH --progress $GIT_REPO blog cd blog cnpm install -d hexo g --watch --debug | tee -a /my-blog/logs/genrate.log
#!/bin/bash echo"Content-Type:text/html" echo"" echo"<h1>ok</h1>" echo"<h3>Prepare to update Blog Posts.....</h3>" cd /my-blog/blog/ git pull
republish.sh
1 2 3 4 5 6 7
#!/bin/bash echo"Content-Type:text/html" echo"" echo"<h1>ok</h1>" echo"<h3>republish blog.....</h3>" cd /my-blog/blog hexo g --force
sources.list
1 2 3 4 5 6 7 8 9
deb http://mirrors.163.com/debian/ stretch main non-free contrib deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib deb-src http://mirrors.163.com/debian/ stretch main non-free contrib deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
启动
1
docker run -d --restart always --name blog -p 8001:80 -p 8002:8081 nas.joylau.cn:5007/joy/blog.joylau.cn:3.0
Updating Homebrew... Warning: You are using macOS 10.15. We do not provide support for this pre-release version. You will encounter build failures with some formulae. Please create pull requests instead of asking for help on Homebrew's GitHub, Discourse, Twitter or IRC. You are responsible for resolving any issues you experience, as you are running this pre-release version.
解决方式
brew doctor
运行后发现源为科大的源, 于是切换回原来的官方的 brew 源
script
1 2
cd "$(brew --repo)" git remote set-url origin https://github.com/Homebrew/brew.git
New JVM Options added: ExitOnOutOfMemoryError and CrashOnOutOfMemoryError Two new JVM flags have been added:
ExitOnOutOfMemoryError - When you enable this option, the JVM exits on the first occurrence of an out-of-memory error. It can be used if you prefer restarting an instance of the JVM rather than handling out of memory errors.
CrashOnOutOfMemoryError - If this option is enabled, when an out-of-memory error occurs, the JVM crashes and produces text and binary crash files (if core files are enabled).