Docker使用久了,会残留很多中间生成的镜像,占用磁盘空间。
要清理Docker镜像,本来是挺简单的,一条命令就搞定了:
| name: Electron CD | |
| on: [push] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} |
| //github.com/shadowsocks/shadowsocks-go/cmd/shadowsocks-local/local.go | |
| import "golang.org/x/net/proxy" | |
| import "github.com/elazarl/goproxy" | |
| import "net/http" | |
| func main(){ | |
| //... | |
| parseServerConfig(config) |
| # The initial version | |
| if [ ! -f .env ] | |
| then | |
| export $(cat .env | xargs) | |
| fi | |
| # My favorite from the comments. Thanks @richarddewit & others! | |
| set -a && source .env && set +a |
| git config --global https.proxy http://127.0.0.1:1080 | |
| git config --global https.proxy https://127.0.0.1:1080 | |
| git config --global --unset http.proxy | |
| git config --global --unset https.proxy | |
| npm config delete proxy |
| # A simple systemd unit file for shadowsocks server (python version) | |
| # See tutorial at shadowsocks' repo master: https://github.com/shadowsocks/shadowsocks/tree/master | |
| # | |
| # Prerequisites | |
| # a) installed shadowsocks server in /usr/local/bin (the default if done through pip) | |
| # b) shadowsocks server configuration json file in /etc/shadowsocks.json | |
| # c) a user called "shadowsocks" that the server will run as | |
| # | |
| # Remember to place this file in /etc/systemd/systemd and then enable this unit with "systemctl enable shadowsocks.service" to have it start at boot |
| npm set registry https://r.npm.taobao.org # 注册模块镜像 | |
| npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像 | |
| ## 以下选择添加 | |
| npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像 | |
| npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像 | |
| npm set ELECTRON_MIRROR https://cdn.npm.taobao.org/dist/electron/ # electron 二进制包镜像 | |
| npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像 | |
| npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像 | |
| npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像 |
| #... | |
| function gitzip() { | |
| git archive -o [email protected] HEAD | |
| } | |
| #... gitzip ZIPPED_FILE_NAME |
| git config --global https.proxy http://127.0.0.1:1080 | |
| git config --global https.proxy https://127.0.0.1:1080 | |
| git config --global --unset http.proxy | |
| git config --global --unset https.proxy | |
| npm config delete proxy |