Skip to content

Commit c2d6e4b

Browse files
committed
test: docker buildx
1 parent 7055164 commit c2d6e4b

File tree

3 files changed

+41
-44
lines changed

3 files changed

+41
-44
lines changed

.github/workflows/docker-image-pull.yml

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,6 @@ jobs:
2828
docker login --username=${{ secrets.ALIYUN_USERNAME }} --password=${{ secrets.ALIYUN_PASSWORD }} registry.cn-hangzhou.aliyuncs.com
2929
3030
# 使用Dockerfile构建镜像
31-
docker pull --platform ${{ matrix.os }}/${{ matrix.architecture }} ghcr.io/codefuse-ai/runtime:0.1.0
32-
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-${{ matrix.architecture }}
33-
docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-${{ matrix.architecture }}
34-
35-
docker pull --platform linux/arm64 ghcr.io/codefuse-ai/runtime:0.1.0
36-
37-
docker pull --platform linux/amd64 ghcr.io/codefuse-ai/ekgservice:0.1.0
38-
docker pull --platform linux/arm64 ghcr.io/codefuse-ai/ekgservice:0.1.0
39-
40-
docker pull --platform linux/amd64 ghcr.io/codefuse-ai/ekgfrontend:0.1.0
41-
docker pull --platform linux/arm64 ghcr.io/codefuse-ai/ekgfrontend:0.1.0
42-
43-
# 推送镜像到镜像仓库
44-
## runtime-amd
45-
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd
46-
docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd
47-
## runtime-arm
48-
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm
49-
docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm
50-
51-
## runtime-amd
52-
docker tag linux/amd64 ghcr.io/codefuse-ai/ekgservice:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/ekgservice:0.1.0-amd
53-
docker push registry.cn-hangzhou.aliyuncs.com/muagent/ekgservice:0.1.0-amd
54-
## runtime-arm
55-
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm
56-
docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm
57-
58-
## runtime-amd
59-
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd
60-
docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-amd
61-
## runtime-arm
62-
docker tag linux/amd64 ghcr.io/codefuse-ai/runtime:0.1.0 registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm
63-
docker push registry.cn-hangzhou.aliyuncs.com/muagent/runtime:0.1.0-arm
31+
docker pull --platform ${{ matrix.os }}/${{ matrix.architecture }} ghcr.io/codefuse-ai/${{ matrix.service }}
32+
docker tag ghcr.io/codefuse-ai/${{ matrix.service }} registry.cn-hangzhou.aliyuncs.com/muagent/${{ matrix.service }}-${{ matrix.architecture }}
33+
docker push registry.cn-hangzhou.aliyuncs.com/muagent/${{ matrix.service }}-${{ matrix.architecture }}

.github/workflows/docker-image.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,43 @@ jobs:
4848
- name: Check disk space
4949
run: df -h
5050

51-
- name: Build and push
52-
uses: docker/build-push-action@v2
53-
with:
54-
context: ${{ matrix.image.context }}
55-
file: ${{ matrix.image.dockerfile }}
56-
push: true
57-
tags: ${{ matrix.image.tag }}
58-
platforms: |
59-
linux/amd64
60-
linux/arm64
51+
- name: docker image
52+
run: |
53+
docker images
54+
docker pull --platform linux/amd64 python:3.9-slim-bookworm
55+
docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
56+
57+
docker pull --platform linux/arm64 python:3.9-slim-bookworm
58+
docker tag python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64
59+
60+
docker buildx imagetools create -t ghcr.io/lightislost/python:3.9-slim-bookworm ghcr.io/lightislost/python:3.9-slim-bookworm-arm64 ghcr.io/lightislost/python:3.9-slim-bookworm-amd64
61+
62+
63+
# - name: Build and push
64+
# uses: docker/build-push-action@v2
65+
# with:
66+
# context: ${{ matrix.image.context }}
67+
# file: ${{ matrix.image.dockerfile }}
68+
# push: true
69+
# tags: ${{ matrix.image.tag }}-amd64
70+
# platforms: linux/amd64
71+
72+
# - name: Build and push
73+
# uses: docker/build-push-action@v2
74+
# with:
75+
# context: ${{ matrix.image.context }}
76+
# file: ${{ matrix.image.dockerfile }}
77+
# push: true
78+
# tags: ${{ matrix.image.tag }}-arm64
79+
# platforms: linux/arm64
80+
# # platforms: |
81+
# # linux/amd64
82+
# # linux/arm64
83+
84+
# - name: docker image
85+
# run: |
86+
# docker images
87+
# docker buildx imagetools create -t ${{ matrix.image.tag }} ${{ matrix.image.tag }}-arm64 ${{ matrix.image.tag }}-amd64
6188

6289
- name: Check disk space
6390
run: df -h

Dockerfile_gh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-bookworm
1+
FROM python:3.9-slim-bookworm
22

33
WORKDIR /home/user
44

0 commit comments

Comments
 (0)