使用 docker buildx 实现多平台编译 - 案例篇

使用 docker buildx 实现多平台编译 - 案例篇 之前的文章中 使用 docker buildx 实现多平台编译 - 环境篇 介绍了如何部署 docker buildx 环境。 笔者本文将要分享自身在使用中的几个比较有意义的案例 0x00 先说结论 docker buildx 本身运行于容器环境, 所以 scheduler 和 builder 本机配置(ex, /etc/hosts, /etc/docker/daemon.json ) 的大部分配置和场景 其实是不可用的。 使用 ssh://user@host 可以方便的执行远程构建, 尤其……

阅读全文

Dockerfile 中 ARG 的使用与其的作用域探究

只有搞懂 Dockerfile 中的 ARG 作用域, 才能算 Build 镜像 CI 刚入门 之前我们讨论了 面试问 Dockerfile 的优化, 千万不要只会说减少层数 , 详细说明 Dockerfile 的优化原理和操作方法, 给大家概括了 简单易记 的口诀。 今天, 我们继续来探讨一下, Dockerfile 中的另外一个利器 – ARG。 如果说掌握 Dockerfile 的优化, 勉强算作读完秘籍的目录。 那只有 熟练 掌握了 ARG 的用法……

阅读全文

tidb 备份恢复与迁移

tidb 备份恢复与迁移 https://pingcap.com/docs-cn/v2.1/reference/tools/download/ 1 wget https://download.pingcap.org/tidb-enterprise-tools-latest-linux-amd64.tar.gz 使用 mydumper 从 mysql/tidb 备份数据 https://pingcap.com/docs-cn/v2.1/how-to/maintain/backup-and-restore/ 使用 mydumper 备份 mydumper: https://github.com/maxbube/mydumper/releases 1 mydumper -h 127.0.0.1 -P 4000 -u root -t 32 -F 64 -B test -T t1,t2 --skip-tz-utc -o ./var/test 我们使用 -B test 表明是对 test 这个 database 操作,然后用 -T t1,t2 表明只导出 t1,t2 两张表。 -t 32 表明使用 32 个线程去导出数据。-F 64 是将实际的 table 切分成多大的 chunk,这里就是 64MB 一个 chunk。 --skip-tz-utc 添加这个参……

阅读全文

使用 cfssl 自签证书

Generate self-signed certificates If you build Container Linux cluster on top of public networks it is recommended to enable encryption for Container Linux services to prevent traffic interception and man-in-the-middle attacks. For these purposes you have to use Certificate Authority (CA), private keys and certificates signed by CA. Let’s use cfssl and walk through the whole process to create all these components. NOTE: We will use basic procedure here. If your configuration requires advanced security options, please refer to official cfssl documentation. Download cfssl CloudFlare’s distributes cfssl source code on github page and binaries on cfssl website . Our documentation assumes that you will run cfssl on your local x86_64 Linux host. 1 2 3 4 5 mkdir ~/bin curl -s -L -o ~/bin/cfssl https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 curl -s -L -o ~/bin/cfssljson https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64 chmod +x ~/bin/{cfssl,cfssljson} export PATH=$PATH:~/bin Initialize a certificate authority……

阅读全文

harbor 使用 s3v4 兼容模式对象存储保存数据

harbor使用 s3v4 兼容模式的对象存储数据 harbor v2.0.0 测试通过 qingcloud qingstor 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 # The default data volume data_volume: /data # Harbor Storage settings by default is using /data dir on local filesystem # Uncomment storage_service setting If you want to using external storage # storage_service: # # ca_bundle is the path to the custom root ca certificate, which will be injected into the truststore # # of registry's and chart repository's containers. This is usually needed when the user hosts a internal storage with self signed certificate. # ca_bundle: #……

阅读全文

gitlab 使用青云 qingstor 对象存储作为存储

gitlab 使用青云 qingstor 对象存储作为存储 使用 s3 compatible 模式, 腾讯云、阿里云、华为云、青云 都可以实现。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 # https://docs.gitlab.com/ce/administration/job_artifacts.html gitlab_rails['artifacts_enabled'] = true gitlab_rails['artifacts_object_store_enabled'] = true gitlab_rails['artifacts_object_store_remote_directory'] = "gitlab-storage-artifacts" gitlab_rails['artifacts_object_store_connection'] = { # s3v4 compatible mode # https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/examples/objectstorage/rails.minio.yaml 'provider' => 'AWS', 'region' => 'us-east-1', 'aws_access_key_id' => 'ACID_XXXXXXXXXXXXXXXXX', 'aws_secret_access_key' => 'ACKEY_YYYYYYYYYYYYYYYY', 'aws_signature_version' => 4, 'host' => 's3.pek3b.qingstor.com', 'endpoint' => "http://s3.pek3b.qingstor.com", 'path_style' => true }……

阅读全文

TiDB 2.1 备份恢复与迁移

TiDB 2.1 备份恢复与迁移 备份 https://pingcap.com/docs-cn/v2.1/how-to/maintain/backup-and-restore/ 使用 mydumper 备份 mydumper: https://github.com/maxbube/mydumper/releases 1 mydumper -h 127.0.0.1 -P 4000 -u root -t 32 -F 64 -B test -T t1,t2 --skip-tz-utc -o ./var/test 我们使用 -B test 表明是对 test 这个 database 操作,然后用 -T t1,t2 表明只导出 t1,t2 两张表。 -t 32 表明使用 32 个线程去导出数据。-F 64 是将实际的 table 切分成多大的 chunk,这里就是 64MB 一个 chunk。 --skip-tz-utc 添加这个参数忽略掉 TiDB 与导数据的……

阅读全文

linux 创建本地源

linux 创建本地源 ubuntu 创建 local repo 将包放在 debs 目录下, 使用如下命令创建 私有仓库索引 1 2 3 cd /data/repo dpkg-scanpackages debs/ /dev/null |gzip > debs/Packages.gz centos 创建 local repo 将包放在 /data/repo/centos7 目录下, 使用如下命令创建 私有仓库索引 1 2 3 cd /data/repo/centos7 createrepo .……

阅读全文

使用 lego 申请 let's encrypt 证书

使用 lego 申请 let’s encrypt 证书 lego 是用来申请 let's encrypt 免费证书的, 现在支持多种验证方式。 以下是使用 alidns 解析验证。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 #!/bin/bash # # lego-letsencrypt.sh # cd $(dirname $0) which lego || { lego_ver=v3.7.0 wget -c https://github.com/go-acme/lego/releases/download/${lego_ver}/lego_${lego_ver}_linux_amd64.tar.gz -o lego.tar.gz tar xf lego.tar.gz cp -a lego /usr/local/bin/lego } DomainList="*.example.com,*.example.org" EMAIL="[email protected]" export ALICLOUD_ACCESS_KEY=LTAxxxxxx export ALICLOUD_SECRET_KEY=yyyyyyyyyyyyyyyyy Domains="" for domain in ${DOMAINs//,/ } do { Domains="${Domains} --domain=${domain}" }……

阅读全文

calico 配置 BGP Route Reflectors

calico 配置 BGP Route Reflectors Calico作为k8s的一个流行网络插件,它依赖BGP路由协议实现集群节点上的POD路由互通;而路由互通的前提是节点间建立 BGP Peer 连接。BGP 路由反射器(Route Reflectors,简称 RR)可以简化集群BGP Peer的连接方式,它是解决BGP扩展性问题的有效方式;具……

阅读全文

福利派送

  • (免费星球)「运维成长路线」

  • 又拍云免费 CDN

最近文章

分类

标签

其它