Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/app-base-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: build app base

on:
workflow_dispatch:
inputs:
ref:
description: "Why trigger?"
required: true
type: string

env:
IMAGE: "deepflow-app"

jobs:
build_app_base_amd64:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: docker version
run: |
docker version

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Log in to GitHub Docker Registry
uses: docker/login-action@v2
with:
registry: "ghcr.io"
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"

- name: Build and push deepflow app base builder images
uses: docker/build-push-action@v3
with:
context: app
push: true
file: app/Dockerfile_base
platforms: linux/amd64
tags: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:main-base-amd64

build_app_base_arm64:
#runs-on: "cirun-aws-arm64-32c--${{ github.run_id }}"
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: docker version
run: |
docker version

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Log in to GitHub Docker Registry
uses: docker/login-action@v2
with:
registry: "ghcr.io"
username: "${{ github.repository_owner }}"
password: "${{ secrets.GITHUB_TOKEN }}"

- name: Build and push deepflow app base builder images
uses: docker/build-push-action@v3
with:
context: app
push: true
file: app/Dockerfile_base
platforms: linux/arm64
tags: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:main-base-arm64
24 changes: 16 additions & 8 deletions .github/workflows/app-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
docker version

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
install: true

Expand All @@ -56,15 +56,19 @@ jobs:
password: "${{ secrets.GITHUB_TOKEN }}"

- name: Build and push deepflow app images
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: app
push: false
file: app/Dockerfile_depends
platforms: linux/amd64
outputs: type=local,dest=./app/output_amd64
# tags: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:main-cache-amd64
cache-from: type=registry,mode=max,ref=ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:main-cache-amd64
cache-to: type=registry,mode=max,ref=ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:main-cache-amd64
build-args: |
OWNER=${{ github.repository_owner }}
IMAGE=${{ env.IMAGE }}

- name: Package code build results
run: |
Expand Down Expand Up @@ -97,7 +101,7 @@ jobs:
docker version

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
install: true

Expand All @@ -109,15 +113,19 @@ jobs:
password: "${{ secrets.GITHUB_TOKEN }}"

- name: Build and push deepflow app images
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: app
push: false
file: app/Dockerfile_depends
platforms: linux/arm64
outputs: type=local,dest=./app/output_arm64
# tags: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:main-cache-arm64
cache-from: type=registry,mode=max,ref=ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:main-cache-arm64
cache-to: type=registry,mode=max,ref=ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:main-cache-arm64
build-args: |
OWNER=${{ github.repository_owner }}
IMAGE=${{ env.IMAGE }}

- name: Package code build results
run: |
Expand Down Expand Up @@ -154,7 +162,7 @@ jobs:
docker version

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
install: true

Expand Down Expand Up @@ -207,7 +215,7 @@ jobs:


- name: Build and push deepflow app images
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: app
push: true
Expand All @@ -219,7 +227,7 @@ jobs:
"deepflowce/${{ env.IMAGE }}:${{ env.IMAGE_TAG_PREFIX }}"

- name: Build and push deepflow app images to hongkong aliyun
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: app
push: true
Expand All @@ -237,7 +245,7 @@ jobs:
password: "${{ secrets.REGISTRY_PASS }}"

- name: Build and push deepflow app images to beijing aliyun
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: app
push: true
Expand Down
17 changes: 17 additions & 0 deletions app/Dockerfile_base
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 构建层
FROM python:3.8-alpine AS builder
RUN apk update && \
apk upgrade && \
apk add --no-cache \
gcc \
g++ \
libc-dev \
python3-dev \
libpq-dev \
mariadb-connector-c-dev \
libffi-dev \
make \
&& \
pip install --upgrade pip

RUN pip install cffi
27 changes: 5 additions & 22 deletions app/Dockerfile_depends
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
# 构建层
FROM python:3.8-alpine AS builder
RUN apk update && \
apk upgrade && \
apk add --no-cache \
gcc \
g++ \
libc-dev \
python3-dev \
libpq-dev \
mariadb-connector-c-dev \
libffi-dev \
make \
&& \
pip install --upgrade pip

# Base 构建层
FROM builder AS builder-base
RUN pip install cffi

# 自定义构建层
FROM builder-base AS builder-custom
ARG OWNER
ARG IMAGE
ARG TARGETARCH
FROM ghcr.io/$OWNER/$IMAGE:main-base-$TARGETARCH AS builder-custom
# FROM builder-base AS builder-custom
RUN pip install --user --disable-pip-version-check \
--no-cache-dir \
aiofiles==23.2.1 aiohttp==3.10.11 aiosignal==1.3.1 async-timeout==4.0.3 attrs==23.1.0 \
Expand All @@ -33,4 +17,3 @@ RUN pip install --user --disable-pip-version-check \
yarl==1.12.1 zipp==3.19.2
FROM scratch
COPY --from=builder-custom /root/.local /

Loading