GaGa's Blog

One GaGa, One World !

多阶段构建 Dockerfile 的几种常见用法

1. 使用数字标记阶段

  • FROM alpineFROM alpine 分别第 0、1 阶段,再通过 COPY --from=0--from=1 将文件集中到最终镜像中。
1
2
3
4
5
6
7
8
9
10
11
# vim Dockerfile
FROM alpine
COPY test1.txt /

FROM alpine
COPY test2.txt /

FROM alpine
COPY --from=0 /test1.txt /tmp
COPY --from=1 /test2.txt /tmp

Read more »

基于docker run部署

1. 使用 Docker 运行 SVN 服务容器

1
2
3
4
5
docker run -d --name svn-server \
--restart always \
-v /data/svn:/var/opt/svn \
-p 3690:3690 \
garethflowers/svn-server:1.7
  • 容器名为 svn-server
  • 数据挂载到宿主机 /data/svn
  • 对外暴露 3690 端口,支持重启自动启动
Read more »

概述

基于 Rocky Linux 9 基础镜像构建 Python 二进制的 Dockerfile,具备以下特性:

  • 多阶段构建,最终镜像精简
  • 可传入 Python 版本构建,支持默认版本
  • 使用阿里云镜像加速 DNF 包源与 Python 源码下载

Read more »

官方推荐镜像地址

1. Docker Hub

Rocky Linux 官方维护的镜像托管在 Docker Hub 上:

1
2
docker pull rockylinux:9
docker pull rockylinux:8
Read more »

1.更新服务配置文件内容(*.service 文件)

比如你修改了 /etc/systemd/system/xxx.service 的内容,或者你想替换成新的服务定义文件。

1
2
3
4
5
6
7
8
9
10
11
12
# 1. 重新加载 systemd 配置(通知 systemd 有服务定义变更)
sudo systemctl daemon-reexec # 可选,重启 systemd 本身(一般不需要)
sudo systemctl daemon-reload # 必须,加载修改后的 *.service 文件

# 2. 如果服务已在运行,建议先重启:
sudo systemctl restart xxx.service

# 可选:设为开机自启
sudo systemctl enable xxx.service

# 可选:检查状态
systemctl status xxx.service

Read more »

conda一键安装脚本特点

  • 🚫 禁止以 root 用户运行
  • 📦 检查安装包是否已存在
  • 🧠 自动接受 ToS 协议
  • ⚡ 配置清华镜像源
  • 🐍 自动创建并激活 Python 3.10 环境 py310

清华conda源禁止root安装提示403

  • 支持ubuntu/centos系列操作系统
Read more »

问题概述

从 Conda 23.11 开始,访问官方频道(如 repo.anaconda.com)必须接受 Terms of Service(ToS)协议,否则就会报错:

CondaToSNonInteractiveError: Terms of Service have not been accepted for the following channels.

Read more »

目标

    1. 使用 host 网络模式
    1. 增加 Redis 密码认证requirepass / masterauth);
    1. 开启 RDB + AOF 双重持久化机制
    1. 把持久化文件(appendonly.aof, dump.rdb, nodes.conf 等)保存在宿主机挂载目录中,确保数据持久。

1.目录结构

Read more »

1.架构与定位

型号 架构 上市时间 主要定位
V100 Volta 2017 高性能计算(HPC)+ 早期 AI 训练
A100 Ampere 2020 高端通用 AI 训练 + 推理(旗舰级)
A10 Ampere 2021 中端 AI 推理 + 中小规模训练 + 图形加速
L20 Lovelace 2024/2025 新一代 AI 推理(LLM/Transformer 优化)+ 大显存部署

2.核心规格对比

Read more »

背景与目的

在使用 SLB(负载均衡)架构的网站部署中,为确保多台 Web 服务器之间文件一致性,文中采用 rsync 工具实现定时同步,从而达到:

  • 保证文件同步
  • 实现高可用性与容灾
  • 支持负载均衡下多台 CentOS 服务器的数据一致性

Read more »
0%