From e9738ce1114d3c679619cdc6fb731c0213e6282c Mon Sep 17 00:00:00 2001 From: gongna1 Date: Tue, 27 Aug 2024 14:10:03 +0800 Subject: [PATCH] feat:Optimize article structure --- _posts/2024-07-29-test-markdown.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/_posts/2024-07-29-test-markdown.md b/_posts/2024-07-29-test-markdown.md index 813f8d37b199..7219dfbc38dd 100644 --- a/_posts/2024-07-29-test-markdown.md +++ b/_posts/2024-07-29-test-markdown.md @@ -74,20 +74,28 @@ docker buildx build --platform linux/arm64 -t your-image-name:your-tag . - 在 Apple M1 上,默认构建的镜像是 ARM 架构的 - 如果需要构建适用于不同架构(如 amd64)的镜像,需要在 Buildx 命令中指定相应的平台。 +ARM64 架构的镜像: + ```shell - docker buildx build --platform linux/arm64 -t test:v1.2 . - docker buildx build --platform linux/arm64 -t test:v1.2 . --load +docker buildx build --platform linux/arm64 -t test:v1.2 . +docker buildx build --platform linux/arm64 -t test:v1.2 . --load ``` +运行镜像: + ```shell docker run --privileged -it --platform linux/arm64 -v $(pwd):/demo test:v1.2 /bin/bash ``` +AMD64 架构的镜像: + ```shell - docker buildx build --platform linux/amd64 -t test:v1.2 . - docker buildx build --platform linux/amd64 -t test:v1.2 . --load +docker buildx build --platform linux/amd64 -t test:v1.2 . +docker buildx build --platform linux/amd64 -t test:v1.2 . --load ``` +运行镜像: + ```shell docker run --privileged -it --platform linux/amd64 -v $(pwd):/demo test:v1.2 /bin/bash ```