Skip to content

Commit cd02b65

Browse files
committed
update post: docker-image & uv
1 parent 5a9b24d commit cd02b65

File tree

11 files changed

+1102
-32
lines changed

11 files changed

+1102
-32
lines changed

content/posts/2025-09-07_docker-image.md

Lines changed: 320 additions & 0 deletions
Large diffs are not rendered by default.

content/posts/2025-09-22_python-uv.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ tags = ['Python']
99

1010
## Features
1111

12-
### Python versions
12+
#### Python versions
1313
- `uv python install`: 安装 Python 版本
1414
- `uv python list`: 查看可用的 Python 版本
1515
- `uv python find`: 查找安装的 Python 版本
1616
- `uv python pin`: 固定当前项目的 Python 版本
1717
- `uv python uninstall`: 卸载一个 Python 版本
1818

19-
### Scripts
19+
#### Scripts
2020
- `uv run`: 运行一个脚本
2121
- `uv add --script`: 为脚本添加一个依赖
2222
- `uv remove --script`: 移除一个依赖
2323

24-
### Projects
24+
#### Projects
2525
使用 `pyproject.toml` 配置项目
2626
- `uv init`: 创建一个 Python 项目
2727
- `uv add`: 为项目添加依赖
@@ -33,15 +33,15 @@ tags = ['Python']
3333
- `uv build`: 将项目构建为分发归档文件
3434
- `uv publish`: 将项目发布到包索引
3535

36-
### Tools
36+
#### Tools
3737
允许与安装工具
3838
- `uvx / uv tool run`: 在临时环境运行一个工具
3939
- `uv tool install`: 安装一个工具
4040
- `uv tool uninstall`: 卸载一个工具
4141
- `uv tool list`: 列出已安装工具
4242
- `uv tool update-shell`: 更新 shell 以包含工具执行
4343

44-
### The pip interface
44+
#### The pip interface
4545
手动管理环境与包, 用于旧的工作流, 或一些高级命令功能
4646
- `uv venv`: 创建虚拟环境
4747

@@ -58,7 +58,7 @@ tags = ['Python']
5858
- `uv pip compile`: 将依赖编译到一个锁文件中
5959
- `uv pip sync`: 使用锁文件同步环境
6060

61-
### Utility
61+
#### Utility
6262
管理与检查 uv 的状态, 例如缓存、存储目录或子升级
6363
- `uv cache clean`: 清除缓存条目
6464
- `uv cache prune`: 移除过期的缓存条目
@@ -80,7 +80,7 @@ name = "example"
8080
version = "0.1.0"
8181
```
8282
额外的项目元数据和配置包含:
83-
- [Python versino requirement](https://docs.astral.sh/uv/concepts/projects/config/#python-version-requirement)
83+
- [Python version requirement](https://docs.astral.sh/uv/concepts/projects/config/#python-version-requirement)
8484
- [Dependencies](https://docs.astral.sh/uv/concepts/projects/dependencies/)
8585
- [Build system](https://docs.astral.sh/uv/concepts/projects/config/#build-systems)
8686
- [Entry points](https://docs.astral.sh/uv/concepts/projects/config/#entry-points)
@@ -89,7 +89,7 @@ version = "0.1.0"
8989
使用 uv 处理项目时, uv 会根据需要创建虚拟环境.
9090
虽然某些 uv 命令会创建临时环境 (`uv run --isolated`), 但 uv 也会在 `pyproject.toml` 旁边的 `.venv` 目录中管理一个持久环境, 其中包含项目及其依赖项.
9191
它存储在项目内部是为了方便编辑器查找, 编辑器需要环境来提供代码补全和类型提示.
92-
不建议将 `.venv` 目录包含在版本控制中, 它会通过内部 `.gitignore` 文件自动从 git 中排除
92+
不建议将 `.venv` 目录包含在版本控制中, 它会通过内部 `.gitignore` 文件自动从 git 中排除.
9393

9494
要在项目环境中运行命令, 应该使用 `uv run`.
9595
或者, 项目环境可以像普通虚拟环境一样正常激活.

public/archives/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<span>3
9090
min</span></div></div></div></div></article><article class="group bg-card border-border hover:bg-accent/50 rounded-lg border p-4 transition-all duration-300"><div class="flex items-center justify-between gap-4"><div class="min-w-0 flex-1"><h4 class="text-foreground group-hover:text-primary mb-3 font-medium transition-colors duration-200"><a href=/posts/docker-images/ class=block>Docker - Images</a></h4><div class="text-muted-foreground flex items-center gap-4 text-xs"><div class="flex items-center gap-1"><svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5A2 2 0 003 7v12a2 2 0 002 2z"/></svg>
9191
<time datetime=2025-09-07>09-07</time></div><div class="flex items-center gap-1"><svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3A9 9 0 113 12a9 9 0 0118 0z"/></svg>
92-
<span>20
92+
<span>24
9393
min</span></div></div></div></div></article><article class="group bg-card border-border hover:bg-accent/50 rounded-lg border p-4 transition-all duration-300"><div class="flex items-center justify-between gap-4"><div class="min-w-0 flex-1"><h4 class="text-foreground group-hover:text-primary mb-3 font-medium transition-colors duration-200"><a href=/posts/docker-workflow/ class=block>Docker - Workflow</a></h4><div class="text-muted-foreground flex items-center gap-4 text-xs"><div class="flex items-center gap-1"><svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5A2 2 0 003 7v12a2 2 0 002 2z"/></svg>
9494
<time datetime=2025-09-06>09-06</time></div><div class="flex items-center gap-1"><svg class="h-3 w-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3A9 9 0 113 12a9 9 0 0118 0z"/></svg>
9595
<span>7

public/index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/index.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Home on Starslayerx' Blog</title><link>https://starslayerx.github.io/</link><description>Recent content in Home on Starslayerx' Blog</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 22 Sep 2025 08:00:00 +0800</lastBuildDate><atom:link href="https://starslayerx.github.io/index.xml" rel="self" type="application/rss+xml"/><item><title>uv - Python package manager</title><link>https://starslayerx.github.io/posts/uv-python-package-manager/</link><pubDate>Mon, 22 Sep 2025 08:00:00 +0800</pubDate><guid>https://starslayerx.github.io/posts/uv-python-package-manager/</guid><description>&lt;p>这篇文章深入介绍 uv 管理 Python 项目的使用&lt;/p>
22
&lt;h2 id="features">Features&lt;/h2>
3-
&lt;h3 id="python-versions">Python versions&lt;/h3>
3+
&lt;h4 id="python-versions">Python versions&lt;/h4>
44
&lt;ul>
55
&lt;li>&lt;code>uv python install&lt;/code>: 安装 Python 版本&lt;/li>
66
&lt;li>&lt;code>uv python list&lt;/code>: 查看可用的 Python 版本&lt;/li>
77
&lt;li>&lt;code>uv python find&lt;/code>: 查找安装的 Python 版本&lt;/li>
88
&lt;li>&lt;code>uv python pin&lt;/code>: 固定当前项目的 Python 版本&lt;/li>
99
&lt;li>&lt;code>uv python uninstall&lt;/code>: 卸载一个 Python 版本&lt;/li>
1010
&lt;/ul>
11-
&lt;h3 id="scripts">Scripts&lt;/h3>
11+
&lt;h4 id="scripts">Scripts&lt;/h4>
1212
&lt;ul>
1313
&lt;li>&lt;code>uv run&lt;/code>: 运行一个脚本&lt;/li>
1414
&lt;li>&lt;code>uv add --script&lt;/code>: 为脚本添加一个依赖&lt;/li>
1515
&lt;li>&lt;code>uv remove --script&lt;/code>: 移除一个依赖&lt;/li>
1616
&lt;/ul>
17-
&lt;h3 id="projects">Projects&lt;/h3>
17+
&lt;h4 id="projects">Projects&lt;/h4>
1818
&lt;p>使用 &lt;code>pyproject.toml&lt;/code> 配置项目&lt;/p></description></item><item><title>Redis Bitmap</title><link>https://starslayerx.github.io/posts/redis-bitmap/</link><pubDate>Fri, 19 Sep 2025 08:00:00 +0800</pubDate><guid>https://starslayerx.github.io/posts/redis-bitmap/</guid><description>&lt;h2 id="bitmap-位图">Bitmap 位图&lt;/h2>
1919
&lt;p>Redis 的位图 bitmap 是由多个二进制位组成的数组,
2020
数组中的每个二进制都有与之对应的偏移量(索引),

0 commit comments

Comments
 (0)