From dbe963eb6a75487f7052a6a627c1cdad77dc9a1e Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Mon, 13 Feb 2023 15:09:37 +0800
Subject: [PATCH 01/41] chore(imagebuilder): use woodpecker replace drone

---
 .drone/drone.yml            | 138 ------------------------------------
 .drone/manifest.tmpl        |  19 -----
 .woodpecker/build-linux.yml |  29 ++++++++
 .woodpecker/chart.yaml      |  28 ++++++++
 .woodpecker/manifest.tmpl   |  18 +++++
 .woodpecker/manifest.yml    |  38 ++++++++++
 .woodpecker/test-linux.yml  |  21 ++++++
 README.md                   |   2 +-
 8 files changed, 135 insertions(+), 158 deletions(-)
 delete mode 100644 .drone/drone.yml
 delete mode 100644 .drone/manifest.tmpl
 create mode 100644 .woodpecker/build-linux.yml
 create mode 100644 .woodpecker/chart.yaml
 create mode 100644 .woodpecker/manifest.tmpl
 create mode 100644 .woodpecker/manifest.yml
 create mode 100644 .woodpecker/test-linux.yml

diff --git a/.drone/drone.yml b/.drone/drone.yml
deleted file mode 100644
index a9984f1..0000000
--- a/.drone/drone.yml
+++ /dev/null
@@ -1,138 +0,0 @@
-kind: pipeline
-type: exec
-name: linux-amd64
-
-platform:
-  arch: amd64
-  os: linux
-
-steps:
-- name: test
-  commands:
-  - mkdir -p $HOMEPATH/.docker; echo $IMAGE_PULL_SECRETS > $HOMEPATH/.docker/config.json
-  - make docker-build test
-  environment:
-    VERSION: ${DRONE_TAG:-latest}-linux-amd64
-    DEV_REGISTRY:
-      from_secret: dev_registry
-    DRYCC_REGISTRY:
-      from_secret: drycc_registry
-    IMAGE_PULL_SECRETS:
-      from_secret: container_pull_secrets
-  when:
-    event:
-    - push
-    - tag
-    - pull_request
-
-- name: publish
-  commands:
-  - echo $CONTAINER_PASSWORD | docker login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
-  - make docker-build docker-immutable-push
-  environment:
-    VERSION: ${DRONE_TAG:-latest}-linux-amd64
-    DEV_REGISTRY:
-      from_secret: dev_registry
-    DRYCC_REGISTRY:
-      from_secret: drycc_registry
-    CONTAINER_USERNAME:
-      from_secret: container_username
-    CONTAINER_PASSWORD:
-      from_secret: container_password
-  when:
-    event:
-    - push
-    - tag
-
----
-kind: pipeline
-type: exec
-name: linux-arm64
-
-platform:
-  arch: arm64
-  os: linux
-
-steps:
-- name: publish
-  commands:
-  - echo $CONTAINER_PASSWORD | docker login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
-  - make docker-build docker-immutable-push
-  environment:
-    VERSION: ${DRONE_TAG:-latest}-linux-arm64
-    DEV_REGISTRY:
-      from_secret: dev_registry
-    DRYCC_REGISTRY:
-      from_secret: drycc_registry
-    CONTAINER_USERNAME:
-      from_secret: container_username
-    CONTAINER_PASSWORD:
-      from_secret: container_password
-  when:
-    event:
-    - push
-    - tag
-
----
-kind: pipeline
-type: docker
-name: manifest
-image_pull_secrets:
-- container_pull_secrets
-
-steps:
-- name: generate manifest
-  image: registry.drycc.cc/drycc/python-dev
-  commands:
-  - sed -i "s/registry.drycc.cc/$${DRYCC_REGISTRY}/g" .drone/manifest.tmpl
-  environment:
-    DRYCC_REGISTRY:
-      from_secret: drycc_registry
-
-- name: publish
-  image: plugins/manifest
-  settings:
-    spec: .drone/manifest.tmpl
-    username:
-      from_secret: container_username
-    password:
-      from_secret: container_password
-  environment:
-    DEV_REGISTRY:
-      from_secret: dev_registry
-    DRYCC_REGISTRY:
-      from_secret: drycc_registry
-
-trigger:
-  event:
-  - push
-  - tag
-
-depends_on:
-- linux-amd64
-- linux-arm64
-
----
-kind: pipeline
-type: exec
-name: chart
-
-steps:
-- name: generate chart
-  commands:
-  - IMAGE_TAG=$([ ! -z $DRONE_TAG ] && echo ${DRONE_TAG:1} || echo \"canary\")
-  - sed -i "s/imageTag:\ \"canary\"/imageTag:\ $IMAGE_TAG/g" charts/imagebuilder/values.yaml
-  - helm package charts/imagebuilder --version $([ -z $DRONE_TAG ] && echo 1.0.0 || echo ${DRONE_TAG#v})
-  - echo $CONTAINER_PASSWORD | helm registry login $DRYCC_REGISTRY -u $CONTAINER_USERNAME --password-stdin
-  - helm push imagebuilder-$([ -z $DRONE_TAG ] && echo 1.0.0 || echo ${DRONE_TAG#v}).tgz oci://$DRYCC_REGISTRY/$([ -z $DRONE_TAG ] && echo charts-testing || echo charts)
-  environment:
-    DRYCC_REGISTRY:
-      from_secret: drycc_registry
-    CONTAINER_USERNAME:
-      from_secret: container_username
-    CONTAINER_PASSWORD:
-      from_secret: container_password
-  when:
-    event:
-    - push
-    - tag
diff --git a/.drone/manifest.tmpl b/.drone/manifest.tmpl
deleted file mode 100644
index 1d43a09..0000000
--- a/.drone/manifest.tmpl
+++ /dev/null
@@ -1,19 +0,0 @@
-
-image: registry.drycc.cc/drycc/imagebuilder:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}canary{{/if}}
-{{#if build.tags}}
-tags:
-{{#each build.tags}}
-  - {{this}}
-{{/each}}
-{{/if}}
-manifests:
-  -
-    image: registry.drycc.cc/drycc/imagebuilder:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-amd64
-    platform:
-      architecture: amd64
-      os: linux
-  -
-    image: registry.drycc.cc/drycc/imagebuilder:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-arm64
-    platform:
-      architecture: arm64
-      os: linux
diff --git a/.woodpecker/build-linux.yml b/.woodpecker/build-linux.yml
new file mode 100644
index 0000000..a345874
--- /dev/null
+++ b/.woodpecker/build-linux.yml
@@ -0,0 +1,29 @@
+matrix:
+  platform:
+    - linux/amd64
+    - linux/arm64
+
+platform: ${platform}
+
+labels:
+  type: exec
+
+pipeline:
+- name: publish-linux
+  image: bash
+  commands:
+  - export VERSION=$([ -z $CI_COMMIT_TAG ] && echo latest || echo $CI_COMMIT_TAG)-$(sed 's#/#-#g' <<< $CI_SYSTEM_ARCH)
+  - echo $CONTAINER_PASSWORD | docker login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
+  - make docker-build docker-immutable-push
+  secrets:
+  - dev_registry
+  - drycc_registry
+  - container_username
+  - container_password
+  when:
+    event:
+    - push
+    - tag
+
+depends_on:
+- test-linux
\ No newline at end of file
diff --git a/.woodpecker/chart.yaml b/.woodpecker/chart.yaml
new file mode 100644
index 0000000..bfecf10
--- /dev/null
+++ b/.woodpecker/chart.yaml
@@ -0,0 +1,28 @@
+platform: linux/amd64
+
+labels:
+  type: exec
+
+pipeline:
+- name: generate-chart
+  type: local
+  image: bash
+  commands:
+  - export VERSION=$(sed 's#v##' <<< $CI_COMMIT_TAG)
+  - export IMAGE_TAG=$([ ! -z $CI_COMMIT_TAG ] && echo \"$VERSION\" || echo \"canary\")
+  - sed -i "s/imageTag:\ \"canary\"/imageTag:\ $IMAGE_TAG/g" charts/$${CI_REPO_NAME}/values.yaml
+  - helm package -u charts/$${CI_REPO_NAME} --version $([ -z $CI_COMMIT_TAG ] && echo 1.0.0 || echo $VERSION)
+  - echo $CONTAINER_PASSWORD | helm registry login $DRYCC_REGISTRY -u $CONTAINER_USERNAME --password-stdin
+  - helm push $${CI_REPO_NAME}-$([ -z $CI_COMMIT_TAG ] && echo 1.0.0 || echo $VERSION).tgz oci://$DRYCC_REGISTRY/$([ -z $CI_COMMIT_TAG ] && echo charts-testing || echo charts)
+  secrets:
+  - dev_registry
+  - drycc_registry
+  - container_username
+  - container_password
+  when:
+    event:
+    - push
+    - tag
+
+depends_on:
+- manifest
\ No newline at end of file
diff --git a/.woodpecker/manifest.tmpl b/.woodpecker/manifest.tmpl
new file mode 100644
index 0000000..8739535
--- /dev/null
+++ b/.woodpecker/manifest.tmpl
@@ -0,0 +1,18 @@
+image: registry.drycc.cc/drycc/{{project}}:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}canary{{/if}}
+{{#if build.tags}}
+tags:
+{{#each build.tags}}
+  - {{this}}
+{{/each}}
+{{/if}}
+manifests:
+  -
+    image: registry.drycc.cc/drycc/{{project}}:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-amd64
+    platform:
+      architecture: amd64
+      os: linux
+  -
+    image: registry.drycc.cc/drycc/{{project}}:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-arm64
+    platform:
+      architecture: arm64
+      os: linux
diff --git a/.woodpecker/manifest.yml b/.woodpecker/manifest.yml
new file mode 100644
index 0000000..f7023ff
--- /dev/null
+++ b/.woodpecker/manifest.yml
@@ -0,0 +1,38 @@
+platform: linux/amd64
+
+labels:
+  type: exec
+
+pipeline:
+- name: generate-manifest
+  image: bash
+  commands:
+  - sed -i "s/{{project}}/$${CI_REPO_NAME}/g" .woodpecker/manifest.tmpl
+  - sed -i "s/registry.drycc.cc/$${DRYCC_REGISTRY}/g" .woodpecker/manifest.tmpl
+  secrets:
+  - drycc_registry
+  when:
+    event:
+    - tag
+    - push
+
+- name: publish-manifest
+  image: bash
+  commands:
+  - docker run --rm
+    -e PLUGIN_SPEC=.woodpecker/manifest.tmpl
+    -e PLUGIN_USERNAME=$CONTAINER_USERNAME
+    -e PLUGIN_PASSWORD=$CONTAINER_PASSWORD
+    -v $(pwd):$(pwd)
+    -w $(pwd)
+    plugins/manifest
+  secrets:
+  - container_username
+  - container_password
+  when:
+    event:
+    - tag
+    - push
+
+depends_on:
+- build-linux
diff --git a/.woodpecker/test-linux.yml b/.woodpecker/test-linux.yml
new file mode 100644
index 0000000..d736541
--- /dev/null
+++ b/.woodpecker/test-linux.yml
@@ -0,0 +1,21 @@
+matrix:
+  platform:
+  - linux/amd64
+  - linux/arm64
+
+platform: ${platform}
+
+labels:
+  type: exec
+
+pipeline:
+- name: test-linux
+  image: bash
+  commands:
+  - make test
+  secrets:
+  - dev_registry
+  when:
+    event:
+    - push
+    - tag
diff --git a/README.md b/README.md
index 4b93a4d..d292dd7 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 # Drycc imagebuilder v3
-[![Build Status](https://drone.drycc.cc/api/badges/drycc/imagebuilder/status.svg)](https://drone.drycc.cc/drycc/imagebuilder)
+[![Build Status](https://woodpecker.drycc.cc/api/badges/drycc/imagebuilder/status.svgg)](https://woodpecker.drycc.cc/drycc/imagebuilder)
 
 Drycc (pronounced DAY-iss) Workflow is an open source Platform as a Service (PaaS) that adds a developer-friendly layer to any [Kubernetes](http://kubernetes.io) cluster, making it easy to deploy and manage applications on your own servers.
 

From ae1b69564b6f09b10a1e584ecc06bf8e0cd9c43a Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Fri, 24 Mar 2023 13:54:45 +0800
Subject: [PATCH 02/41] fix(imagebuilder): manifest error

---
 .woodpecker/manifest.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.woodpecker/manifest.yml b/.woodpecker/manifest.yml
index f7023ff..7f6ec36 100644
--- a/.woodpecker/manifest.yml
+++ b/.woodpecker/manifest.yml
@@ -23,6 +23,7 @@ pipeline:
     -e PLUGIN_SPEC=.woodpecker/manifest.tmpl
     -e PLUGIN_USERNAME=$CONTAINER_USERNAME
     -e PLUGIN_PASSWORD=$CONTAINER_PASSWORD
+    -e DRONE_TAG=$CI_COMMIT_TAG
     -v $(pwd):$(pwd)
     -w $(pwd)
     plugins/manifest

From 30a55f1adf7863ed1bcbdb11fbcede3e2721cfb9 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@users.noreply.github.com>
Date: Tue, 30 May 2023 16:38:11 +0800
Subject: [PATCH 03/41] fix(imagebuilder): build svg

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index d292dd7..f1515ac 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
 # Drycc imagebuilder v3
-[![Build Status](https://woodpecker.drycc.cc/api/badges/drycc/imagebuilder/status.svgg)](https://woodpecker.drycc.cc/drycc/imagebuilder)
+[![Build Status](https://woodpecker.drycc.cc/api/badges/drycc/imagebuilder/status.svg)](https://woodpecker.drycc.cc/drycc/imagebuilder)
 
 Drycc (pronounced DAY-iss) Workflow is an open source Platform as a Service (PaaS) that adds a developer-friendly layer to any [Kubernetes](http://kubernetes.io) cluster, making it easy to deploy and manage applications on your own servers.
 

From f609412c33e6dda3994e18fc235043dbba779b43 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Wed, 31 May 2023 12:30:17 +0800
Subject: [PATCH 04/41] chore(imagebuilder): add chart appVersion

---
 .woodpecker/chart.yaml         | 6 ++++--
 charts/imagebuilder/Chart.yaml | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/.woodpecker/chart.yaml b/.woodpecker/chart.yaml
index bfecf10..3204cf5 100644
--- a/.woodpecker/chart.yaml
+++ b/.woodpecker/chart.yaml
@@ -10,10 +10,12 @@ pipeline:
   commands:
   - export VERSION=$(sed 's#v##' <<< $CI_COMMIT_TAG)
   - export IMAGE_TAG=$([ ! -z $CI_COMMIT_TAG ] && echo \"$VERSION\" || echo \"canary\")
+  - export APP_VERSION=$([ ! -z $CI_COMMIT_TAG ] && echo $VERSION || echo 1.0.0)
+  - export CHART_VERSION=$([ -z $CI_COMMIT_TAG ] && echo 1.0.0 || echo $VERSION)
   - sed -i "s/imageTag:\ \"canary\"/imageTag:\ $IMAGE_TAG/g" charts/$${CI_REPO_NAME}/values.yaml
-  - helm package -u charts/$${CI_REPO_NAME} --version $([ -z $CI_COMMIT_TAG ] && echo 1.0.0 || echo $VERSION)
+  - helm package -u charts/$${CI_REPO_NAME} --version $CHART_VERSION --app-version $APP_VERSION
   - echo $CONTAINER_PASSWORD | helm registry login $DRYCC_REGISTRY -u $CONTAINER_USERNAME --password-stdin
-  - helm push $${CI_REPO_NAME}-$([ -z $CI_COMMIT_TAG ] && echo 1.0.0 || echo $VERSION).tgz oci://$DRYCC_REGISTRY/$([ -z $CI_COMMIT_TAG ] && echo charts-testing || echo charts)
+  - helm push $${CI_REPO_NAME}-$CHART_VERSION.tgz oci://$DRYCC_REGISTRY/$([ -z $CI_COMMIT_TAG ] && echo charts-testing || echo charts)
   secrets:
   - dev_registry
   - drycc_registry
diff --git a/charts/imagebuilder/Chart.yaml b/charts/imagebuilder/Chart.yaml
index 0417601..ea04b30 100644
--- a/charts/imagebuilder/Chart.yaml
+++ b/charts/imagebuilder/Chart.yaml
@@ -1,6 +1,7 @@
 name: imagebuilder
 home: https://github.com/drycc/imagebuilder
 apiVersion: v2
+appVersion: 1.0.0
 version: v1.0.0
 description: Imagebuilder application builder for Drycc Workflow.
 maintainers:

From c357c75eeeaba39c9080edd10f9e3868d000cefc Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Wed, 31 May 2023 15:05:25 +0800
Subject: [PATCH 05/41] chore(imagebuilder): upgrade stack version

---
 rootfs/Dockerfile         | 8 ++++----
 rootfs/imagebuilder/build | 1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index 6d239f7..d0de4fc 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -3,11 +3,11 @@ FROM registry.drycc.cc/drycc/base:bullseye
 ENV DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
-  PODMAN_VERSION="4.2.0" \
+  PODMAN_VERSION="4.5.1" \
   MC_VERSION="2022.08.28.20.08.11" \
-  CADDY_VERSION="2.5.2" \
-  PACK_VERSION="0.27.0" \
-  GOSU_VERSION="1.14"
+  CADDY_VERSION="2.6.4" \
+  PACK_VERSION="0.29.0" \
+  GOSU_VERSION="1.16"
 
 RUN groupadd drycc --gid ${DRYCC_GID} \
   && useradd drycc -u ${DRYCC_UID} -g ${DRYCC_GID} -s /bin/bash -m -d ${DRYCC_HOME_DIR}
diff --git a/rootfs/imagebuilder/build b/rootfs/imagebuilder/build
index 11cc7f8..42e99df 100755
--- a/rootfs/imagebuilder/build
+++ b/rootfs/imagebuilder/build
@@ -119,6 +119,7 @@ else
             --publish \
             --cache-image ${image_cache_name} \
             --tag ${image_latest_name} \
+            --default-process web \
             --network host"
     if [[ $log_level == "debug" ]] ; then
         pack_build="$pack_build --verbose"

From b01b6ac056c8105615cbd65e8d5fd09c8c6130f6 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Mon, 12 Jun 2023 16:08:47 +0800
Subject: [PATCH 06/41] chore(imagebuilder): add drycc_app env

---
 rootfs/imagebuilder/build | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rootfs/imagebuilder/build b/rootfs/imagebuilder/build
index 42e99df..abb87ca 100755
--- a/rootfs/imagebuilder/build
+++ b/rootfs/imagebuilder/build
@@ -90,6 +90,7 @@ else
 fi
 
 # Get image name and image tag
+drycc_app=$(echo "${IMAGE_NAME}" | awk -F '/' '{print $NF}' | awk -F ':' '{print $1}')
 image_tag=$(echo "${IMAGE_NAME}" | awk -F ':' '{print $NF}')
 image_base_name=$(echo "${IMAGE_NAME}" | sed -s "s#:${image_tag}##g")
 image_cache_name="${image_base_name}":cache
@@ -114,6 +115,7 @@ else
 
     pack_build="pack build ${IMAGE_NAME} \
             --builder ${pack_builder} \
+            --env DRYCC_APP=${drycc_app} \
             --docker-host ${DOCKER_HOST} \
             --previous-image ${image_latest_name} \
             --publish \

From b81c95c545c09bdf423da9e98cfc0d0d713a9846 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Fri, 16 Jun 2023 15:25:06 +0800
Subject: [PATCH 07/41] chore(imagebuilder): upgrade to bookworm

---
 charts/imagebuilder/templates/imagebuilder-configmap.yaml | 2 +-
 rootfs/Dockerfile                                         | 4 ++--
 rootfs/imagebuilder/build                                 | 6 ++++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/charts/imagebuilder/templates/imagebuilder-configmap.yaml b/charts/imagebuilder/templates/imagebuilder-configmap.yaml
index 4aa17fd..bf6eb45 100644
--- a/charts/imagebuilder/templates/imagebuilder-configmap.yaml
+++ b/charts/imagebuilder/templates/imagebuilder-configmap.yaml
@@ -5,7 +5,7 @@ metadata:
   labels:
     heritage: drycc
 data:
-  buildpacks: "{{.Values.imageRegistry}}/{{.Values.imageOrg}}/buildpacks:bullseye"
+  buildpacks: "{{.Values.imageRegistry}}/{{.Values.imageOrg}}/buildpacks:bookworm"
   auths.json: |
     {
         "auths": {
diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index d0de4fc..ad45bc7 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -1,10 +1,10 @@
-FROM registry.drycc.cc/drycc/base:bullseye
+FROM registry.drycc.cc/drycc/base:bookworm
 
 ENV DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
   PODMAN_VERSION="4.5.1" \
-  MC_VERSION="2022.08.28.20.08.11" \
+  MC_VERSION="2023.06.15.15.08.26" \
   CADDY_VERSION="2.6.4" \
   PACK_VERSION="0.29.0" \
   GOSU_VERSION="1.16"
diff --git a/rootfs/imagebuilder/build b/rootfs/imagebuilder/build
index abb87ca..dbb5c03 100755
--- a/rootfs/imagebuilder/build
+++ b/rootfs/imagebuilder/build
@@ -43,7 +43,8 @@ if [ -f "${from_registries_file}" ]; then
     install -D  "${from_registries_file}" "${CONTAINERS_CONFIG_DIR}"/registries.conf
 fi
 
-readonly REGISTRY_AUTH_FILE="${HOME}"/.docker/config.json
+REGISTRY_AUTH_FILE="${HOME}"/.docker/config.json
+readonly REGISTRY_AUTH_FILE
 from_auths_file="/etc/imagebuilder/auths.json"
 if [ -f "${from_auths_file}" ]; then
     install -D "${from_auths_file}" "${REGISTRY_AUTH_FILE}"
@@ -110,7 +111,8 @@ else
     echo "---> Building pack"
     echo "---> Using builder ${pack_builder}"
     # podman connection
-    readonly DOCKER_HOST="unix://$(podman info -f "{{.Host.RemoteSocket.Path}}")"
+    DOCKER_HOST="unix://$(podman info -f "{{.Host.RemoteSocket.Path}}")"
+    readonly DOCKER_HOST
     export DOCKER_HOST
 
     pack_build="pack build ${IMAGE_NAME} \

From 3adcaba4b218fb087f08e454361dee42d3786067 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Tue, 20 Jun 2023 15:39:32 +0800
Subject: [PATCH 08/41] chore(imagebuilder): add codename build-arg

---
 .woodpecker/build-linux.yml                               | 1 +
 .woodpecker/test-linux.yml                                | 1 +
 Makefile                                                  | 4 ++--
 charts/imagebuilder/templates/imagebuilder-configmap.yaml | 2 +-
 charts/imagebuilder/values.yaml                           | 1 +
 rootfs/Dockerfile                                         | 5 +++--
 6 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/.woodpecker/build-linux.yml b/.woodpecker/build-linux.yml
index a345874..db9ad17 100644
--- a/.woodpecker/build-linux.yml
+++ b/.woodpecker/build-linux.yml
@@ -16,6 +16,7 @@ pipeline:
   - echo $CONTAINER_PASSWORD | docker login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
   - make docker-build docker-immutable-push
   secrets:
+  - codename
   - dev_registry
   - drycc_registry
   - container_username
diff --git a/.woodpecker/test-linux.yml b/.woodpecker/test-linux.yml
index d736541..313179e 100644
--- a/.woodpecker/test-linux.yml
+++ b/.woodpecker/test-linux.yml
@@ -14,6 +14,7 @@ pipeline:
   commands:
   - make test
   secrets:
+  - codename
   - dev_registry
   when:
     event:
diff --git a/Makefile b/Makefile
index 51a9b3d..884fc4b 100644
--- a/Makefile
+++ b/Makefile
@@ -28,11 +28,11 @@ build:
 	@echo Nothing to do.
 
 docker-build:
-	docker build ${DOCKER_BUILD_FLAGS} -t ${IMAGE} -f rootfs/Dockerfile rootfs
+	docker build ${DOCKER_BUILD_FLAGS} --build-arg CODENAME=${CODENAME} -t ${IMAGE} -f rootfs/Dockerfile rootfs
 	docker tag ${IMAGE} ${MUTABLE_IMAGE}
 
 docker-buildx:
-	docker buildx build --platform ${PLATFORM} ${DOCKER_BUILD_FLAGS} -t ${IMAGE} -f rootfs/Dockerfile rootfs --push
+	docker buildx build --build-arg CODENAME=${CODENAME} --platform ${PLATFORM} ${DOCKER_BUILD_FLAGS} -t ${IMAGE} -f rootfs/Dockerfile rootfs --push
 
 deploy: docker-build docker-push
 
diff --git a/charts/imagebuilder/templates/imagebuilder-configmap.yaml b/charts/imagebuilder/templates/imagebuilder-configmap.yaml
index bf6eb45..490b705 100644
--- a/charts/imagebuilder/templates/imagebuilder-configmap.yaml
+++ b/charts/imagebuilder/templates/imagebuilder-configmap.yaml
@@ -5,7 +5,7 @@ metadata:
   labels:
     heritage: drycc
 data:
-  buildpacks: "{{.Values.imageRegistry}}/{{.Values.imageOrg}}/buildpacks:bookworm"
+  buildpacks: "{{.Values.imageRegistry}}/{{.Values.imageOrg}}/buildpacks:{{.Values.codename}}"
   auths.json: |
     {
         "auths": {
diff --git a/charts/imagebuilder/values.yaml b/charts/imagebuilder/values.yaml
index bdf1389..f2383d4 100644
--- a/charts/imagebuilder/values.yaml
+++ b/charts/imagebuilder/values.yaml
@@ -2,6 +2,7 @@ imageOrg: "drycc"
 imagePullPolicy: "Always"
 imageTag: "canary"
 imageRegistry: "registry.drycc.cc"
+codename: bookworm
 containerRegistries: |
   unqualified-search-registries = ["registry.drycc.cc"]
   short-name-mode="permissive"
\ No newline at end of file
diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index ad45bc7..91a4377 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -1,10 +1,11 @@
-FROM registry.drycc.cc/drycc/base:bookworm
+ARG CODENAME
+FROM registry.drycc.cc/drycc/base:${CODENAME}
 
 ENV DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
   PODMAN_VERSION="4.5.1" \
-  MC_VERSION="2023.06.15.15.08.26" \
+  MC_VERSION="2023.06.23.18.12.07" \
   CADDY_VERSION="2.6.4" \
   PACK_VERSION="0.29.0" \
   GOSU_VERSION="1.16"

From 0e5181e2efc8839812ee43f21835e6e660e1c3f7 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Thu, 3 Aug 2023 10:26:19 +0800
Subject: [PATCH 09/41] chore(imagebuilder): upgrade podman/mc/caddy

---
 rootfs/Dockerfile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index 91a4377..d78d32f 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -4,9 +4,9 @@ FROM registry.drycc.cc/drycc/base:${CODENAME}
 ENV DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
-  PODMAN_VERSION="4.5.1" \
-  MC_VERSION="2023.06.23.18.12.07" \
-  CADDY_VERSION="2.6.4" \
+  PODMAN_VERSION="4.6.0" \
+  MC_VERSION="2023.07.21.20.44.27" \
+  CADDY_VERSION="2.7.1" \
   PACK_VERSION="0.29.0" \
   GOSU_VERSION="1.16"
 

From c28ef6b7478422a90025bbf6770395dec8b87e64 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Thu, 28 Sep 2023 08:46:26 +0800
Subject: [PATCH 10/41] chore(imagebuilder): use podman replace docker

---
 .woodpecker/build-linux.yml                   |  4 +-
 .woodpecker/manifest.yml                      |  4 +-
 Makefile                                      | 19 +++----
 .../templates/imagebuilder-networkpolicy.yaml | 53 +++++++++++++++++++
 charts/imagebuilder/values.yaml               |  2 +-
 rootfs/Dockerfile                             |  7 ++-
 rootfs/imagebuilder/build                     | 35 +++++++-----
 versioning.mk                                 | 18 +++----
 8 files changed, 99 insertions(+), 43 deletions(-)
 create mode 100644 charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml

diff --git a/.woodpecker/build-linux.yml b/.woodpecker/build-linux.yml
index db9ad17..8cdd984 100644
--- a/.woodpecker/build-linux.yml
+++ b/.woodpecker/build-linux.yml
@@ -13,8 +13,8 @@ pipeline:
   image: bash
   commands:
   - export VERSION=$([ -z $CI_COMMIT_TAG ] && echo latest || echo $CI_COMMIT_TAG)-$(sed 's#/#-#g' <<< $CI_SYSTEM_ARCH)
-  - echo $CONTAINER_PASSWORD | docker login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
-  - make docker-build docker-immutable-push
+  - echo $CONTAINER_PASSWORD | podman login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
+  - make podman-build podman-immutable-push
   secrets:
   - codename
   - dev_registry
diff --git a/.woodpecker/manifest.yml b/.woodpecker/manifest.yml
index 7f6ec36..2d5c4e5 100644
--- a/.woodpecker/manifest.yml
+++ b/.woodpecker/manifest.yml
@@ -19,14 +19,14 @@ pipeline:
 - name: publish-manifest
   image: bash
   commands:
-  - docker run --rm
+  - podman run --rm
     -e PLUGIN_SPEC=.woodpecker/manifest.tmpl
     -e PLUGIN_USERNAME=$CONTAINER_USERNAME
     -e PLUGIN_PASSWORD=$CONTAINER_PASSWORD
     -e DRONE_TAG=$CI_COMMIT_TAG
     -v $(pwd):$(pwd)
     -w $(pwd)
-    plugins/manifest
+    docker.io/plugins/manifest
   secrets:
   - container_username
   - container_password
diff --git a/Makefile b/Makefile
index 884fc4b..338c04b 100644
--- a/Makefile
+++ b/Makefile
@@ -16,10 +16,10 @@ SHELL_SCRIPTS = $(wildcard _scripts/*.sh) \
 # and other build options
 DEV_ENV_IMAGE := ${DEV_REGISTRY}/drycc/go-dev
 DEV_ENV_WORK_DIR := /opt/drycc/go/src/${REPO_PATH}
-DEV_ENV_CMD := docker run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
-DEV_ENV_CMD_INT := docker run -it --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
+DEV_ENV_CMD := podman run --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
+DEV_ENV_CMD_INT := podman run -it --rm -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR} ${DEV_ENV_IMAGE}
 
-all: build docker-build docker-push
+all: build podman-build podman-push
 
 bootstrap:
 	@echo Nothing to do.
@@ -27,14 +27,11 @@ bootstrap:
 build:
 	@echo Nothing to do.
 
-docker-build:
-	docker build ${DOCKER_BUILD_FLAGS} --build-arg CODENAME=${CODENAME} -t ${IMAGE} -f rootfs/Dockerfile rootfs
-	docker tag ${IMAGE} ${MUTABLE_IMAGE}
+podman-build:
+	podman build ${CONTAINER_BUILD_FLAGS} --build-arg CODENAME=${CODENAME} -t ${IMAGE} -f rootfs/Dockerfile rootfs
+	podman tag ${IMAGE} ${MUTABLE_IMAGE}
 
-docker-buildx:
-	docker buildx build --build-arg CODENAME=${CODENAME} --platform ${PLATFORM} ${DOCKER_BUILD_FLAGS} -t ${IMAGE} -f rootfs/Dockerfile rootfs --push
-
-deploy: docker-build docker-push
+deploy: podman-build podman-push
 
 kube-pod: kube-service
 	kubectl create -f ${POD}
@@ -61,5 +58,5 @@ test-style:
 test-functional:
 	@echo "Implement functional tests in _tests directory"
 
-.PHONY: all bootstrap build docker-build docker-push deploy kube-pod kube-secrets \
+.PHONY: all bootstrap build podman-build podman-push deploy kube-pod kube-secrets \
 	secrets kube-service kube-clean test
diff --git a/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml b/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml
new file mode 100644
index 0000000..e28771c
--- /dev/null
+++ b/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml
@@ -0,0 +1,53 @@
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+  name: imagebuilder-networkpolicy
+spec:
+  podSelector:
+    matchLabels:
+      app: drycc-imagebuilder
+  policyTypes:
+  - Egress
+  egress:
+  - to:
+    - namespaceSelector:
+        matchLabels:
+          kubernetes.io/metadata.name: kube-system
+    - podSelector:
+        matchLabels:
+          k8s-app: kube-dns
+    ports:
+    - protocol: UDP
+      port: 53
+  - to:
+    - ipBlock:
+        cidr: ::/0
+        except:
+        - fc00::/7
+  - to:
+    - ipBlock:
+        cidr: 0.0.0.0/0
+        except:
+        - 10.0.0.0/8
+        - 172.16.0.0/12
+        - 192.168.0.0/16
+  - to:
+    - namespaceSelector:
+        matchLabels:
+          kubernetes.io/metadata.name: {{ .Release.Name }}
+    - podSelector:
+        matchLabels:
+          app: drycc-registry
+    ports:
+    - protocol: TCP
+      port: 5000
+  - to:
+    - namespaceSelector:
+        matchLabels:
+          kubernetes.io/metadata.name: {{ .Release.Name }}
+    - podSelector:
+        matchLabels:
+          app: drycc-storage-metanode-weed
+    ports:
+    - protocol: TCP
+      port: 8333
diff --git a/charts/imagebuilder/values.yaml b/charts/imagebuilder/values.yaml
index f2383d4..a8061c8 100644
--- a/charts/imagebuilder/values.yaml
+++ b/charts/imagebuilder/values.yaml
@@ -5,4 +5,4 @@ imageRegistry: "registry.drycc.cc"
 codename: bookworm
 containerRegistries: |
   unqualified-search-registries = ["registry.drycc.cc"]
-  short-name-mode="permissive"
\ No newline at end of file
+  short-name-mode="permissive"
diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index d78d32f..6ec580e 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -4,10 +4,10 @@ FROM registry.drycc.cc/drycc/base:${CODENAME}
 ENV DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
-  PODMAN_VERSION="4.6.0" \
-  MC_VERSION="2023.07.21.20.44.27" \
+  PODMAN_VERSION="4.7.1" \
+  MC_VERSION="2023.09.20.15.22.31" \
   CADDY_VERSION="2.7.1" \
-  PACK_VERSION="0.29.0" \
+  PACK_VERSION="0.31.0" \
   GOSU_VERSION="1.16"
 
 RUN groupadd drycc --gid ${DRYCC_GID} \
@@ -41,4 +41,3 @@ RUN install-packages procps psmisc \
 WORKDIR /workspace
 
 ENTRYPOINT ["init-stack", "/imagebuilder/prebuild", "/imagebuilder/build"]
-
diff --git a/rootfs/imagebuilder/build b/rootfs/imagebuilder/build
index dbb5c03..87b0e4d 100755
--- a/rootfs/imagebuilder/build
+++ b/rootfs/imagebuilder/build
@@ -1,7 +1,14 @@
 #!/usr/bin/env bash
 set -eo pipefail
 shopt -s expand_aliases
-alias podman="podman --cgroup-manager=cgroupfs --events-backend=file"
+
+log_level="error"
+if [[ "${DRYCC_DEBUG}" ]]; then
+    log_level="debug"
+    unset DRYCC_DEBUG
+fi
+
+alias podman='podman --log-level ${log_level} --cgroup-manager=cgroupfs --events-backend=file'
 
 function clean_before_exit {
     # delay before exiting, so stdout/stderr flushes through the logging system
@@ -29,12 +36,6 @@ function waiting_process {
     done
 }
 
-log_level="error"
-if [[ "${DRYCC_DEBUG}" ]]; then
-    log_level="debug"
-    unset DRYCC_DEBUG
-fi
-
 CONTAINERS_CONFIG_DIR="${HOME}"/.config/containers
 mkdir -p "${CONTAINERS_CONFIG_DIR}"
 from_registries_file="/etc/imagebuilder/registries.conf"
@@ -43,6 +44,8 @@ if [ -f "${from_registries_file}" ]; then
     install -D  "${from_registries_file}" "${CONTAINERS_CONFIG_DIR}"/registries.conf
 fi
 
+# The directory cannot be changed, the position is hard coded, pack cli needs to be used.
+# https://github.com/buildpacks/pack/blob/main/internal/docker/context.go
 REGISTRY_AUTH_FILE="${HOME}"/.docker/config.json
 readonly REGISTRY_AUTH_FILE
 from_auths_file="/etc/imagebuilder/auths.json"
@@ -100,23 +103,27 @@ image_latest_name="${image_base_name}":latest
 # Building
 if [[ "${DRYCC_STACK}" == "container" ]] ; then
     echo "---> Building container"
-    if [[ $log_level == "debug" ]] ; then
-        podman build --tag"${IMAGE_NAME}" --network host .
-        podman push "${IMAGE_NAME}" --tls-verify=false
-    else
-        podman build --quiet --tag "${IMAGE_NAME}" --network host .
-        podman push "${IMAGE_NAME}" --quiet --tls-verify=false
+    podman_build="podman build . --tag ${IMAGE_NAME} --network host"
+    podman_push="podman push ${IMAGE_NAME} --tls-verify=false"
+    if [[ -f .build-env ]] ; then
+        for build_arg in $( < .build-env )
+        do
+            podman_build="$podman_build --build-arg $build_arg"
+        done
     fi
+    $podman_build
+    $podman_push
 else
     echo "---> Building pack"
     echo "---> Using builder ${pack_builder}"
     # podman connection
-    DOCKER_HOST="unix://$(podman info -f "{{.Host.RemoteSocket.Path}}")"
+    DOCKER_HOST="unix://$(podman info -f '{{.Host.RemoteSocket.Path}}')"
     readonly DOCKER_HOST
     export DOCKER_HOST
 
     pack_build="pack build ${IMAGE_NAME} \
             --builder ${pack_builder} \
+            --lifecycle-image ${pack_builder} \
             --env DRYCC_APP=${drycc_app} \
             --docker-host ${DOCKER_HOST} \
             --previous-image ${image_latest_name} \
diff --git a/versioning.mk b/versioning.mk
index a9523f7..072dd72 100644
--- a/versioning.mk
+++ b/versioning.mk
@@ -1,6 +1,6 @@
 MUTABLE_VERSION ?= canary
 VERSION ?= git-$(shell git rev-parse --short HEAD)
-DOCKER_BUILD_FLAGS ?= --pull
+CONTAINER_BUILD_FLAGS ?= --pull
 
 IMAGE := ${DRYCC_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}:${VERSION}
 MUTABLE_IMAGE := ${DRYCC_REGISTRY}/${IMAGE_PREFIX}/${SHORT_NAME}:${MUTABLE_VERSION}
@@ -11,13 +11,13 @@ info:
 	@echo "Immutable tag:   ${IMAGE}"
 	@echo "Mutable tag:     ${MUTABLE_IMAGE}"
 
-.PHONY: docker-push
-docker-push: docker-immutable-push docker-mutable-push
+.PHONY: podman-push
+podman-push: podman-immutable-push podman-mutable-push
 
-.PHONY: docker-immutable-push
-docker-immutable-push:
-	docker push ${IMAGE}
+.PHONY: podman-immutable-push
+podman-immutable-push:
+	podman push ${IMAGE}
 
-.PHONY: docker-mutable-push
-docker-mutable-push:
-	docker push ${MUTABLE_IMAGE}
+.PHONY: podman-mutable-push
+podman-mutable-push:
+	podman push ${MUTABLE_IMAGE}

From 3ec73a89eee00e1f21db8866eddada6b5c304f8c Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Tue, 5 Mar 2024 17:53:28 +0800
Subject: [PATCH 11/41] chore(charts): allow all dns

---
 .../imagebuilder/templates/imagebuilder-networkpolicy.yaml  | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml b/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml
index e28771c..6774fe0 100644
--- a/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml
+++ b/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml
@@ -10,12 +10,6 @@ spec:
   - Egress
   egress:
   - to:
-    - namespaceSelector:
-        matchLabels:
-          kubernetes.io/metadata.name: kube-system
-    - podSelector:
-        matchLabels:
-          k8s-app: kube-dns
     ports:
     - protocol: UDP
       port: 53

From a1b8c92c7cf8571140f10594b5aefc1289f00942 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Mon, 18 Mar 2024 17:11:14 +0800
Subject: [PATCH 12/41] chore(woodpecker): migrations woodpecker-ci to 2

---
 .woodpecker/build-linux.yml | 5 ++---
 .woodpecker/chart.yaml      | 6 ++----
 .woodpecker/manifest.yml    | 5 ++---
 .woodpecker/test-linux.yml  | 5 ++---
 4 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/.woodpecker/build-linux.yml b/.woodpecker/build-linux.yml
index 8cdd984..f411033 100644
--- a/.woodpecker/build-linux.yml
+++ b/.woodpecker/build-linux.yml
@@ -3,12 +3,11 @@ matrix:
     - linux/amd64
     - linux/arm64
 
-platform: ${platform}
-
 labels:
   type: exec
+  platform: ${platform}
 
-pipeline:
+steps:
 - name: publish-linux
   image: bash
   commands:
diff --git a/.woodpecker/chart.yaml b/.woodpecker/chart.yaml
index 3204cf5..20f9ea9 100644
--- a/.woodpecker/chart.yaml
+++ b/.woodpecker/chart.yaml
@@ -1,11 +1,9 @@
-platform: linux/amd64
-
 labels:
   type: exec
+  platform: linux/amd64
 
-pipeline:
+steps:
 - name: generate-chart
-  type: local
   image: bash
   commands:
   - export VERSION=$(sed 's#v##' <<< $CI_COMMIT_TAG)
diff --git a/.woodpecker/manifest.yml b/.woodpecker/manifest.yml
index 2d5c4e5..b4735ee 100644
--- a/.woodpecker/manifest.yml
+++ b/.woodpecker/manifest.yml
@@ -1,9 +1,8 @@
-platform: linux/amd64
-
 labels:
   type: exec
+  platform: linux/amd64
 
-pipeline:
+steps:
 - name: generate-manifest
   image: bash
   commands:
diff --git a/.woodpecker/test-linux.yml b/.woodpecker/test-linux.yml
index 313179e..d47ccc5 100644
--- a/.woodpecker/test-linux.yml
+++ b/.woodpecker/test-linux.yml
@@ -3,12 +3,11 @@ matrix:
   - linux/amd64
   - linux/arm64
 
-platform: ${platform}
-
 labels:
   type: exec
+  platform: ${platform}
 
-pipeline:
+steps:
 - name: test-linux
   image: bash
   commands:

From 7703c64a546a2aaa7492d1c85adc1ebe9dbc8387 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Tue, 19 Mar 2024 23:14:45 +0800
Subject: [PATCH 13/41] fix(woodpecker): CI_SYSTEM_ARCH env removed

---
 .woodpecker/build-linux.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.woodpecker/build-linux.yml b/.woodpecker/build-linux.yml
index f411033..782d2f5 100644
--- a/.woodpecker/build-linux.yml
+++ b/.woodpecker/build-linux.yml
@@ -11,7 +11,7 @@ steps:
 - name: publish-linux
   image: bash
   commands:
-  - export VERSION=$([ -z $CI_COMMIT_TAG ] && echo latest || echo $CI_COMMIT_TAG)-$(sed 's#/#-#g' <<< $CI_SYSTEM_ARCH)
+  - export VERSION=$([ -z $CI_COMMIT_TAG ] && echo latest || echo $CI_COMMIT_TAG)-$(sed 's#/#-#g' <<< $CI_SYSTEM_PLATFORM)
   - echo $CONTAINER_PASSWORD | podman login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
   - make podman-build podman-immutable-push
   secrets:

From 96288fb0835b027580061528871d0857ee8a40e8 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Wed, 20 Mar 2024 14:18:44 +0800
Subject: [PATCH 14/41] chore(charts): change canary app version

---
 .woodpecker/chart.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.woodpecker/chart.yaml b/.woodpecker/chart.yaml
index 20f9ea9..5aa7eb3 100644
--- a/.woodpecker/chart.yaml
+++ b/.woodpecker/chart.yaml
@@ -8,7 +8,7 @@ steps:
   commands:
   - export VERSION=$(sed 's#v##' <<< $CI_COMMIT_TAG)
   - export IMAGE_TAG=$([ ! -z $CI_COMMIT_TAG ] && echo \"$VERSION\" || echo \"canary\")
-  - export APP_VERSION=$([ ! -z $CI_COMMIT_TAG ] && echo $VERSION || echo 1.0.0)
+  - export APP_VERSION=$([ -z $CI_COMMIT_TAG ] && echo $CI_COMMIT_SHA || echo $VERSION)
   - export CHART_VERSION=$([ -z $CI_COMMIT_TAG ] && echo 1.0.0 || echo $VERSION)
   - sed -i "s/imageTag:\ \"canary\"/imageTag:\ $IMAGE_TAG/g" charts/$${CI_REPO_NAME}/values.yaml
   - helm package -u charts/$${CI_REPO_NAME} --version $CHART_VERSION --app-version $APP_VERSION
@@ -25,4 +25,4 @@ steps:
     - tag
 
 depends_on:
-- manifest
\ No newline at end of file
+- manifest

From 85b1bcc602cce107a79cb8108dd5b5238f124eeb Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Fri, 5 Apr 2024 18:46:04 +0800
Subject: [PATCH 15/41] feat(pipeline): add dryccfile support

---
 rootfs/Dockerfile         |  4 +++
 rootfs/imagebuilder/build | 60 ++++++++++++++++++++++++++++-----------
 2 files changed, 48 insertions(+), 16 deletions(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index 6ec580e..84cdd7c 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -4,6 +4,8 @@ FROM registry.drycc.cc/drycc/base:${CODENAME}
 ENV DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
+  JQ_VERSION="1.7.1" \
+  YQ_VERSION="4.43.1" \
   PODMAN_VERSION="4.7.1" \
   MC_VERSION="2023.09.20.15.22.31" \
   CADDY_VERSION="2.7.1" \
@@ -16,6 +18,8 @@ RUN groupadd drycc --gid ${DRYCC_GID} \
 ADD . /
 
 RUN install-packages procps psmisc \
+  && install-stack jq $JQ_VERSION \
+  && install-stack yq $YQ_VERSION \
   && install-stack podman $PODMAN_VERSION \
   && install-stack mc $MC_VERSION \
   && install-stack caddy $CADDY_VERSION \
diff --git a/rootfs/imagebuilder/build b/rootfs/imagebuilder/build
index 87b0e4d..3a207ec 100755
--- a/rootfs/imagebuilder/build
+++ b/rootfs/imagebuilder/build
@@ -93,26 +93,50 @@ else
         --tls-verify=false > /dev/null
 fi
 
-# Get image name and image tag
-drycc_app=$(echo "${IMAGE_NAME}" | awk -F '/' '{print $NF}' | awk -F ':' '{print $1}')
-image_tag=$(echo "${IMAGE_NAME}" | awk -F ':' '{print $NF}')
-image_base_name=$(echo "${IMAGE_NAME}" | sed -s "s#:${image_tag}##g")
-image_cache_name="${image_base_name}":cache
-image_latest_name="${image_base_name}":latest
+envfile="${HOME}"/.config/build-env
+dryccfile="drycc.yaml"
+# create build-env
+touch "${envfile}"
+if [[ -f .build-env ]] ; then
+    cat .build-env >> "${envfile}"
+fi
+if [[ -f "$dryccfile" ]]; then
+    config=$(cat < "$dryccfile" | yq .build.config -o json)
+    if [[ $config != null ]]; then
+        mapfile -t items < <(echo "$config" | jq -c -r 'to_entries[] | (.key, .value)')
+        for ((i=0; i<"${#items[@]}"; i=i+2)); do
+            echo "${items[i]}=${items[i+1]}" >> "${envfile}"
+        done
+    fi
+fi
 
 # Building
 if [[ "${DRYCC_STACK}" == "container" ]] ; then
     echo "---> Building container"
-    podman_build="podman build . --tag ${IMAGE_NAME} --network host"
-    podman_push="podman push ${IMAGE_NAME} --tls-verify=false"
-    if [[ -f .build-env ]] ; then
-        for build_arg in $( < .build-env )
+    builds=("web" "Dockerfile")
+    if [[ -e "$dryccfile" ]]; then
+        docker=$(cat < "$dryccfile" | yq .build.docker -o json)
+        if [[ $docker != null ]]; then
+            mapfile -t builds < <(echo "$docker" | jq -c -r 'to_entries[] | (.key, .value)')
+        fi
+    fi
+    for ((i=0; i<"${#builds[@]}"; i=i+2)); do
+        procfile_type="${builds[i]}"
+        if [[ "${procfile_type}" == "web" ]]; then
+            image="${IMAGE_NAME}"
+        else
+            image="${IMAGE_NAME}"-"${procfile_type}"
+        fi
+        dockerfile="${builds[i+1]}"
+        podman_build="podman build . -f ${dockerfile} --tag ${image} --network host"
+        podman_push="podman push ${image} --tls-verify=false"
+        for build_arg in $( < "${envfile}" )
         do
             podman_build="$podman_build --build-arg $build_arg"
         done
-    fi
-    $podman_build
-    $podman_push
+        $podman_build
+        $podman_push
+    done
 else
     echo "---> Building pack"
     echo "---> Using builder ${pack_builder}"
@@ -120,6 +144,12 @@ else
     DOCKER_HOST="unix://$(podman info -f '{{.Host.RemoteSocket.Path}}')"
     readonly DOCKER_HOST
     export DOCKER_HOST
+    # Get image name and image tag
+    drycc_app=$(echo "${IMAGE_NAME}" | awk -F '/' '{print $NF}' | awk -F ':' '{print $1}')
+    image_tag=$(echo "${IMAGE_NAME}" | awk -F ':' '{print $NF}')
+    image_base_name=$(echo "${IMAGE_NAME}" | sed -s "s#:${image_tag}##g")
+    image_cache_name="${image_base_name}":cache
+    image_latest_name="${image_base_name}":latest
 
     pack_build="pack build ${IMAGE_NAME} \
             --builder ${pack_builder} \
@@ -131,6 +161,7 @@ else
             --cache-image ${image_cache_name} \
             --tag ${image_latest_name} \
             --default-process web \
+            --env-file ${envfile} \
             --network host"
     if [[ $log_level == "debug" ]] ; then
         pack_build="$pack_build --verbose"
@@ -138,8 +169,5 @@ else
     if [[ -f .clear-cache ]]; then
         pack_build="$pack_build --clear-cache"
     fi
-    if [[ -f .build-env ]] ; then
-        pack_build="$pack_build --env-file .build-env"
-    fi
     $pack_build
 fi
\ No newline at end of file

From 9ecbd8c2c5c35b9a8ec812e780881d6d9143e62d Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Fri, 26 Apr 2024 23:43:28 +0800
Subject: [PATCH 16/41] feat(config): add typed values

---
 rootfs/imagebuilder/build | 44 ++++++++++++++++++++++++++++-----------
 1 file changed, 32 insertions(+), 12 deletions(-)

diff --git a/rootfs/imagebuilder/build b/rootfs/imagebuilder/build
index 3a207ec..6672160 100755
--- a/rootfs/imagebuilder/build
+++ b/rootfs/imagebuilder/build
@@ -36,6 +36,26 @@ function waiting_process {
     done
 }
 
+function write_build_env {
+    local envfile dryccfile command config items i
+    envfile=$1
+    dryccfile=$2
+    if [[ -z "$3" ]]; then
+        command=".build.config"
+    else
+        command=".build.config.${3}"
+    fi
+    if [[ -f "$dryccfile" ]]; then
+        config=$(cat < "$dryccfile" | yq "$command" -o json)
+        if [[ $config != null ]]; then
+            mapfile -t items < <(echo "$config" | jq -c -r 'to_entries[] | (.key, .value)')
+            for ((i=0; i<"${#items[@]}"; i=i+2)); do
+                echo "${items[i]}=${items[i+1]}" >> "${envfile}"
+            done
+        fi
+    fi
+}
+
 CONTAINERS_CONFIG_DIR="${HOME}"/.config/containers
 mkdir -p "${CONTAINERS_CONFIG_DIR}"
 from_registries_file="/etc/imagebuilder/registries.conf"
@@ -96,19 +116,10 @@ fi
 envfile="${HOME}"/.config/build-env
 dryccfile="drycc.yaml"
 # create build-env
-touch "${envfile}"
+echo "" > "${envfile}"
 if [[ -f .build-env ]] ; then
     cat .build-env >> "${envfile}"
 fi
-if [[ -f "$dryccfile" ]]; then
-    config=$(cat < "$dryccfile" | yq .build.config -o json)
-    if [[ $config != null ]]; then
-        mapfile -t items < <(echo "$config" | jq -c -r 'to_entries[] | (.key, .value)')
-        for ((i=0; i<"${#items[@]}"; i=i+2)); do
-            echo "${items[i]}=${items[i+1]}" >> "${envfile}"
-        done
-    fi
-fi
 
 # Building
 if [[ "${DRYCC_STACK}" == "container" ]] ; then
@@ -118,6 +129,8 @@ if [[ "${DRYCC_STACK}" == "container" ]] ; then
         docker=$(cat < "$dryccfile" | yq .build.docker -o json)
         if [[ $docker != null ]]; then
             mapfile -t builds < <(echo "$docker" | jq -c -r 'to_entries[] | (.key, .value)')
+        else
+            write_build_env "$envfile" "$dryccfile"
         fi
     fi
     for ((i=0; i<"${#builds[@]}"; i=i+2)); do
@@ -134,6 +147,13 @@ if [[ "${DRYCC_STACK}" == "container" ]] ; then
         do
             podman_build="$podman_build --build-arg $build_arg"
         done
+        typed_envfile="${HOME}/.config/build-env-${procfile_type}"
+        echo "" > "$typed_envfile"
+        write_build_env "$typed_envfile" "$dryccfile" "$procfile_type"
+        for build_arg in $( < "${typed_envfile}" )
+        do
+            podman_build="$podman_build --build-arg $build_arg"
+        done
         $podman_build
         $podman_push
     done
@@ -150,7 +170,7 @@ else
     image_base_name=$(echo "${IMAGE_NAME}" | sed -s "s#:${image_tag}##g")
     image_cache_name="${image_base_name}":cache
     image_latest_name="${image_base_name}":latest
-
+    write_build_env "$envfile" "$dryccfile"
     pack_build="pack build ${IMAGE_NAME} \
             --builder ${pack_builder} \
             --lifecycle-image ${pack_builder} \
@@ -170,4 +190,4 @@ else
         pack_build="$pack_build --clear-cache"
     fi
     $pack_build
-fi
\ No newline at end of file
+fi

From b7bcb563e956a279ddf3bb45ab45d154c3e5fddf Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Thu, 30 May 2024 17:14:50 +0800
Subject: [PATCH 17/41] chore(woodpecker): add cron

---
 .woodpecker/build-linux.yml |  1 +
 .woodpecker/manifest.yml    |  2 ++
 rootfs/Dockerfile           | 12 ++++++------
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/.woodpecker/build-linux.yml b/.woodpecker/build-linux.yml
index 782d2f5..4b74f5c 100644
--- a/.woodpecker/build-linux.yml
+++ b/.woodpecker/build-linux.yml
@@ -24,6 +24,7 @@ steps:
     event:
     - push
     - tag
+    - cron
 
 depends_on:
 - test-linux
\ No newline at end of file
diff --git a/.woodpecker/manifest.yml b/.woodpecker/manifest.yml
index b4735ee..d256c0a 100644
--- a/.woodpecker/manifest.yml
+++ b/.woodpecker/manifest.yml
@@ -14,6 +14,7 @@ steps:
     event:
     - tag
     - push
+    - cron
 
 - name: publish-manifest
   image: bash
@@ -33,6 +34,7 @@ steps:
     event:
     - tag
     - push
+    - cron
 
 depends_on:
 - build-linux
diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index 84cdd7c..5e50b52 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -5,12 +5,12 @@ ENV DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
   JQ_VERSION="1.7.1" \
-  YQ_VERSION="4.43.1" \
-  PODMAN_VERSION="4.7.1" \
-  MC_VERSION="2023.09.20.15.22.31" \
-  CADDY_VERSION="2.7.1" \
-  PACK_VERSION="0.31.0" \
-  GOSU_VERSION="1.16"
+  YQ_VERSION="4.44.1" \
+  PODMAN_VERSION="5.0.3" \
+  MC_VERSION="2024.05.09.17.04.24" \
+  CADDY_VERSION="2.7.6" \
+  PACK_VERSION="0.33.2" \
+  GOSU_VERSION="1.17"
 
 RUN groupadd drycc --gid ${DRYCC_GID} \
   && useradd drycc -u ${DRYCC_UID} -g ${DRYCC_GID} -s /bin/bash -m -d ${DRYCC_HOME_DIR}

From 3d2eb3bf2ac68095c9fc9d709beaa94bf1bb8623 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Thu, 5 Sep 2024 12:59:06 +0800
Subject: [PATCH 18/41] fix(podman): permission denied

---
 rootfs/imagebuilder/prebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rootfs/imagebuilder/prebuild b/rootfs/imagebuilder/prebuild
index 5e43335..6d4c96b 100755
--- a/rootfs/imagebuilder/prebuild
+++ b/rootfs/imagebuilder/prebuild
@@ -3,5 +3,5 @@
 set -e
 
 mount --make-rshared /
-chown "${DRYCC_UID}":"${DRYCC_GID}" -R /workspace
+chown "${DRYCC_UID}":"${DRYCC_GID}" -R /workspace /opt/drycc
 exec gosu "${DRYCC_UID}" "$@"
\ No newline at end of file

From 62a5f193d0f595e71b98c7582d3b9c229b302f8f Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Thu, 5 Sep 2024 13:19:14 +0800
Subject: [PATCH 19/41] chore(imagebuilder): bump stack version

---
 rootfs/Dockerfile            | 10 +++++-----
 rootfs/imagebuilder/build    |  2 ++
 rootfs/imagebuilder/prebuild |  2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index 5e50b52..b72c99a 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -5,11 +5,11 @@ ENV DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
   JQ_VERSION="1.7.1" \
-  YQ_VERSION="4.44.1" \
-  PODMAN_VERSION="5.0.3" \
-  MC_VERSION="2024.05.09.17.04.24" \
-  CADDY_VERSION="2.7.6" \
-  PACK_VERSION="0.33.2" \
+  YQ_VERSION="4.44.3" \
+  PODMAN_VERSION="5.2.2" \
+  MC_VERSION="2024.08.26.10.49.58" \
+  CADDY_VERSION="2.8.4" \
+  PACK_VERSION="0.35.1" \
   GOSU_VERSION="1.17"
 
 RUN groupadd drycc --gid ${DRYCC_GID} \
diff --git a/rootfs/imagebuilder/build b/rootfs/imagebuilder/build
index 6672160..66a15b6 100755
--- a/rootfs/imagebuilder/build
+++ b/rootfs/imagebuilder/build
@@ -74,6 +74,8 @@ if [ -f "${from_auths_file}" ]; then
 fi
 export REGISTRY_AUTH_FILE
 
+
+mkdir -p "/tmp/storage-run-$(id -u)/podman"
 podman system service --time 0 &
 
 waiting_process podman
diff --git a/rootfs/imagebuilder/prebuild b/rootfs/imagebuilder/prebuild
index 6d4c96b..5e43335 100755
--- a/rootfs/imagebuilder/prebuild
+++ b/rootfs/imagebuilder/prebuild
@@ -3,5 +3,5 @@
 set -e
 
 mount --make-rshared /
-chown "${DRYCC_UID}":"${DRYCC_GID}" -R /workspace /opt/drycc
+chown "${DRYCC_UID}":"${DRYCC_GID}" -R /workspace
 exec gosu "${DRYCC_UID}" "$@"
\ No newline at end of file

From b955ca3c1a073c7e05232dd39f6256170c94de1a Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Fri, 6 Sep 2024 08:58:01 +0800
Subject: [PATCH 20/41] fix(podman): failed to reexec

---
 rootfs/imagebuilder/build | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/rootfs/imagebuilder/build b/rootfs/imagebuilder/build
index 66a15b6..a02abd3 100755
--- a/rootfs/imagebuilder/build
+++ b/rootfs/imagebuilder/build
@@ -74,8 +74,9 @@ if [ -f "${from_auths_file}" ]; then
 fi
 export REGISTRY_AUTH_FILE
 
-
-mkdir -p "/tmp/storage-run-$(id -u)/podman"
+# fix: failed to reexec: Permission denied
+podman version>/dev/null 2>&1 || podman version
+# podman service
 podman system service --time 0 &
 
 waiting_process podman

From 2946f5b0671cf40d9dce3d15576cc6fb49b84924 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Mon, 23 Dec 2024 14:24:53 +0800
Subject: [PATCH 21/41] fix(wooddpecker): secsets are deprecated

---
 .woodpecker/build-linux.yml | 17 +++++++++++------
 .woodpecker/chart.yaml      | 14 +++++++++-----
 .woodpecker/manifest.yml    | 13 ++++++++-----
 .woodpecker/test-linux.yml  |  8 +++++---
 4 files changed, 33 insertions(+), 19 deletions(-)

diff --git a/.woodpecker/build-linux.yml b/.woodpecker/build-linux.yml
index 4b74f5c..ef4ecfd 100644
--- a/.woodpecker/build-linux.yml
+++ b/.woodpecker/build-linux.yml
@@ -14,12 +14,17 @@ steps:
   - export VERSION=$([ -z $CI_COMMIT_TAG ] && echo latest || echo $CI_COMMIT_TAG)-$(sed 's#/#-#g' <<< $CI_SYSTEM_PLATFORM)
   - echo $CONTAINER_PASSWORD | podman login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
   - make podman-build podman-immutable-push
-  secrets:
-  - codename
-  - dev_registry
-  - drycc_registry
-  - container_username
-  - container_password
+  environment:
+    CODENAME:
+      from_secret: codename
+    DEV_REGISTRY:
+      from_secret: dev_registry
+    DRYCC_REGISTRY:
+      from_secret: drycc_registry
+    CONTAINER_USERNAME:
+      from_secret: container_username
+    CONTAINER_PASSWORD:
+      from_secret: container_password
   when:
     event:
     - push
diff --git a/.woodpecker/chart.yaml b/.woodpecker/chart.yaml
index 5aa7eb3..40397e0 100644
--- a/.woodpecker/chart.yaml
+++ b/.woodpecker/chart.yaml
@@ -14,11 +14,15 @@ steps:
   - helm package -u charts/$${CI_REPO_NAME} --version $CHART_VERSION --app-version $APP_VERSION
   - echo $CONTAINER_PASSWORD | helm registry login $DRYCC_REGISTRY -u $CONTAINER_USERNAME --password-stdin
   - helm push $${CI_REPO_NAME}-$CHART_VERSION.tgz oci://$DRYCC_REGISTRY/$([ -z $CI_COMMIT_TAG ] && echo charts-testing || echo charts)
-  secrets:
-  - dev_registry
-  - drycc_registry
-  - container_username
-  - container_password
+  environment:
+    DEV_REGISTRY:
+      from_secret: dev_registry
+    DRYCC_REGISTRY:
+      from_secret: drycc_registry
+    CONTAINER_USERNAME:
+      from_secret: container_username
+    CONTAINER_PASSWORD:
+      from_secret: container_password
   when:
     event:
     - push
diff --git a/.woodpecker/manifest.yml b/.woodpecker/manifest.yml
index d256c0a..19fc70c 100644
--- a/.woodpecker/manifest.yml
+++ b/.woodpecker/manifest.yml
@@ -8,8 +8,9 @@ steps:
   commands:
   - sed -i "s/{{project}}/$${CI_REPO_NAME}/g" .woodpecker/manifest.tmpl
   - sed -i "s/registry.drycc.cc/$${DRYCC_REGISTRY}/g" .woodpecker/manifest.tmpl
-  secrets:
-  - drycc_registry
+  environment:
+    DRYCC_REGISTRY:
+      from_secret: drycc_registry
   when:
     event:
     - tag
@@ -27,9 +28,11 @@ steps:
     -v $(pwd):$(pwd)
     -w $(pwd)
     docker.io/plugins/manifest
-  secrets:
-  - container_username
-  - container_password
+  environment:
+    CONTAINER_USERNAME:
+      from_secret: container_username
+    CONTAINER_PASSWORD:
+      from_secret: container_password
   when:
     event:
     - tag
diff --git a/.woodpecker/test-linux.yml b/.woodpecker/test-linux.yml
index d47ccc5..0d5a93f 100644
--- a/.woodpecker/test-linux.yml
+++ b/.woodpecker/test-linux.yml
@@ -12,9 +12,11 @@ steps:
   image: bash
   commands:
   - make test
-  secrets:
-  - codename
-  - dev_registry
+  environment:
+    CODENAME:
+      from_secret: codename
+    DEV_REGISTRY:
+      from_secret: dev_registry
   when:
     event:
     - push

From 91e276eb902720baaf45877f409b1a118b77517c Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Tue, 24 Dec 2024 18:27:12 +0800
Subject: [PATCH 22/41] chore(build): change build args format

---
 rootfs/imagebuilder/build | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/rootfs/imagebuilder/build b/rootfs/imagebuilder/build
index a02abd3..ed5f2f2 100755
--- a/rootfs/imagebuilder/build
+++ b/rootfs/imagebuilder/build
@@ -37,10 +37,12 @@ function waiting_process {
 }
 
 function write_build_env {
-    local envfile dryccfile command config items i
+    local envfile dryccfile command config items i arraytype
     envfile=$1
     dryccfile=$2
-    if [[ -z "$3" ]]; then
+    arraytype=$(cat < "$dryccfile" | yq ".build" -o json | jq '.config|type=="array"')
+
+    if [[ -z "$3" || "$arraytype" == "true" ]]; then
         command=".build.config"
     else
         command=".build.config.${3}"
@@ -48,7 +50,7 @@ function write_build_env {
     if [[ -f "$dryccfile" ]]; then
         config=$(cat < "$dryccfile" | yq "$command" -o json)
         if [[ $config != null ]]; then
-            mapfile -t items < <(echo "$config" | jq -c -r 'to_entries[] | (.key, .value)')
+            mapfile -t items < <(echo "$config" | jq -c -r '.[] | (.name, .value)')
             for ((i=0; i<"${#items[@]}"; i=i+2)); do
                 echo "${items[i]}=${items[i+1]}" >> "${envfile}"
             done

From 451c72d557a8e2a1762800c5a7a6ca434513183b Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Thu, 26 Dec 2024 11:30:11 +0800
Subject: [PATCH 23/41] chore(deps): bump stack version

---
 rootfs/Dockerfile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index b72c99a..6802f92 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -5,11 +5,11 @@ ENV DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
   JQ_VERSION="1.7.1" \
-  YQ_VERSION="4.44.3" \
-  PODMAN_VERSION="5.2.2" \
-  MC_VERSION="2024.08.26.10.49.58" \
+  YQ_VERSION="4.44.6" \
+  PODMAN_VERSION="5.3.1" \
+  MC_VERSION="2024.11.21.17.21.54" \
   CADDY_VERSION="2.8.4" \
-  PACK_VERSION="0.35.1" \
+  PACK_VERSION="0.36.1" \
   GOSU_VERSION="1.17"
 
 RUN groupadd drycc --gid ${DRYCC_GID} \

From 2681e2917c340dcf2ec8789760ce82a0ce6c3b40 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Fri, 27 Dec 2024 11:05:09 +0800
Subject: [PATCH 24/41] fix(woodpecker): cron run error

---
 .woodpecker/chart.yaml     | 1 +
 .woodpecker/test-linux.yml | 1 +
 2 files changed, 2 insertions(+)

diff --git a/.woodpecker/chart.yaml b/.woodpecker/chart.yaml
index 40397e0..cfcd3ec 100644
--- a/.woodpecker/chart.yaml
+++ b/.woodpecker/chart.yaml
@@ -27,6 +27,7 @@ steps:
     event:
     - push
     - tag
+    - cron
 
 depends_on:
 - manifest
diff --git a/.woodpecker/test-linux.yml b/.woodpecker/test-linux.yml
index 0d5a93f..194832f 100644
--- a/.woodpecker/test-linux.yml
+++ b/.woodpecker/test-linux.yml
@@ -21,3 +21,4 @@ steps:
     event:
     - push
     - tag
+    - cron

From 91007b38ec4115ed30dcc6b4fe6ea092b6fc0a5c Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Wed, 15 Jan 2025 13:17:01 +0800
Subject: [PATCH 25/41] feat(build): add drycc v2 support

---
 README.md                 |  18 +++++--
 rootfs/imagebuilder/build | 102 ++++++++++++++++++++------------------
 2 files changed, 68 insertions(+), 52 deletions(-)

diff --git a/README.md b/README.md
index f1515ac..1702973 100644
--- a/README.md
+++ b/README.md
@@ -7,15 +7,27 @@ For more information about the Drycc Workflow, please visit the main project pag
 
 We welcome your input! If you have feedback, please [submit an issue][issues]. If you'd like to participate in development, please read the "Development" section below and [submit a pull request][prs].
 
-# About
+# Build config
 
 The V3 version of imagebuilder unifies the building model, uses the latest CNCF [buildpack](https://github.com/buildpacks) building program, and also supports the dockerfile format.
 
 You can use `DRYCC_STACK` specifies the construction mode. Currently, you can choose two construction formats: `container` and `buildpack`.
 
-If you want to disable caching during building, you only need to generate a `.clear-cache` file in the root directory of the project.
+## Build arg config
 
-# Development
+In Container Build, build arguments (ARG) a means to pass information into the build process. You can use them to parameterize the build, allowing for more flexible and configurable builds.
+
+It can be configured through `.build-arg`, argument=value to supply to the builder, this configuration file is universal in both container and buildpack scenarios.
+
+## Container config
+
+Normally, in container mode, as long as there is a Dockerfile in the root directory, it is sufficient, but we can use [drycc config path](https://www.drycc.cc/docs/applications/using-dryccpath/) to configure the build process more finely.
+
+## Buildpack config
+
+Add an empty `.clean_cache` file, clear image's associated cache before building.
+
+## Development
 
 The Drycc project welcomes contributions from all developers. The high level process for development matches many other open source projects. See below for an outline.
 
diff --git a/rootfs/imagebuilder/build b/rootfs/imagebuilder/build
index ed5f2f2..51ab3a4 100755
--- a/rootfs/imagebuilder/build
+++ b/rootfs/imagebuilder/build
@@ -36,21 +36,38 @@ function waiting_process {
     done
 }
 
-function write_build_env {
-    local envfile dryccfile command config items i arraytype
-    envfile=$1
+function podman_publish {
+    local image dryccfile
+    image=$1
     dryccfile=$2
-    arraytype=$(cat < "$dryccfile" | yq ".build" -o json | jq '.config|type=="array"')
 
-    if [[ -z "$3" || "$arraytype" == "true" ]]; then
-        command=".build.config"
-    else
-        command=".build.config.${3}"
+    podman_build="podman build . -f ${dockerfile} --tag ${image} --network host"
+    podman_push="podman push ${image} --tls-verify=false"
+    # append build arg
+    for build_arg in $( < "${envfile}" )
+    do
+        podman_build="$podman_build --build-arg $build_arg"
+    done
+    # append ptype build arg
+    if [[ -n "$3" ]]; then
+        for build_arg in $( < "${3}" )
+        do
+            podman_build="$podman_build --build-arg $build_arg"
+        done
     fi
+    # build and push
+    $podman_build
+    $podman_push
+}
+
+function write_build_env {
+    local envfile dryccfile config items i
+    envfile=$1
+    dryccfile=$2
     if [[ -f "$dryccfile" ]]; then
-        config=$(cat < "$dryccfile" | yq "$command" -o json)
+        config=$(cat < "$dryccfile" | yq ".build.arg" -o json)
         if [[ $config != null ]]; then
-            mapfile -t items < <(echo "$config" | jq -c -r '.[] | (.name, .value)')
+            mapfile -t items < <(echo "$config" | jq -c -r 'to_entries[] | (.key, .value)')
             for ((i=0; i<"${#items[@]}"; i=i+2)); do
                 echo "${items[i]}=${items[i+1]}" >> "${envfile}"
             done
@@ -118,50 +135,38 @@ else
         --tls-verify=false > /dev/null
 fi
 
-envfile="${HOME}"/.config/build-env
-dryccfile="drycc.yaml"
-# create build-env
+# create global build-arg
+envfile="${HOME}"/.config/build-arg
 echo "" > "${envfile}"
-if [[ -f .build-env ]] ; then
-    cat .build-env >> "${envfile}"
+if [[ -f .build-arg ]] ; then
+    cat .build-arg >> "${envfile}"
 fi
 
 # Building
 if [[ "${DRYCC_STACK}" == "container" ]] ; then
-    echo "---> Building container"
-    builds=("web" "Dockerfile")
-    if [[ -e "$dryccfile" ]]; then
-        docker=$(cat < "$dryccfile" | yq .build.docker -o json)
-        if [[ $docker != null ]]; then
-            mapfile -t builds < <(echo "$docker" | jq -c -r 'to_entries[] | (.key, .value)')
-        else
-            write_build_env "$envfile" "$dryccfile"
-        fi
-    fi
-    for ((i=0; i<"${#builds[@]}"; i=i+2)); do
-        procfile_type="${builds[i]}"
-        if [[ "${procfile_type}" == "web" ]]; then
-            image="${IMAGE_NAME}"
-        else
-            image="${IMAGE_NAME}"-"${procfile_type}"
-        fi
-        dockerfile="${builds[i+1]}"
-        podman_build="podman build . -f ${dockerfile} --tag ${image} --network host"
-        podman_push="podman push ${image} --tls-verify=false"
-        for build_arg in $( < "${envfile}" )
-        do
-            podman_build="$podman_build --build-arg $build_arg"
-        done
-        typed_envfile="${HOME}/.config/build-env-${procfile_type}"
-        echo "" > "$typed_envfile"
-        write_build_env "$typed_envfile" "$dryccfile" "$procfile_type"
-        for build_arg in $( < "${typed_envfile}" )
-        do
-            podman_build="$podman_build --build-arg $build_arg"
+    if [[ -d ".drycc" ]]; then
+        for dryccfile in $(find .drycc | grep -E '.(yml|yaml)$'); do
+            ptype=$(cat < "$dryccfile" | yq .ptype -o auto)
+            build=$(cat < "$dryccfile" | yq .build -o json)
+            if [[ "$build" != "null" ]]; then
+                dockerfile=$(echo "$build" | jq -r '.docker // "Dockerfile"')
+                if [[ "${ptype}" == "web" ]]; then
+                    image="${IMAGE_NAME}"
+                else
+                    image="${IMAGE_NAME}"-"${ptype}"
+                fi
+                # create ptype build-arg
+                ptype_envfile="${HOME}/.config/build-arg-${ptype}"
+                echo "" > "$ptype_envfile"
+                write_build_env "$ptype_envfile" "$dryccfile"
+                podman_publish "${image}" "${dockerfile}" "${ptype_envfile}"
+            fi
         done
-        $podman_build
-        $podman_push
-    done
+    fi
+    # build default image
+    if [[ -f "Dockerfile" ]] && [[ $(podman images -q "${IMAGE_NAME}") == "" ]]; then
+        podman_publish "${IMAGE_NAME}" "Dockerfile"
+    fi
 else
     echo "---> Building pack"
     echo "---> Using builder ${pack_builder}"
@@ -175,7 +180,6 @@ else
     image_base_name=$(echo "${IMAGE_NAME}" | sed -s "s#:${image_tag}##g")
     image_cache_name="${image_base_name}":cache
     image_latest_name="${image_base_name}":latest
-    write_build_env "$envfile" "$dryccfile"
     pack_build="pack build ${IMAGE_NAME} \
             --builder ${pack_builder} \
             --lifecycle-image ${pack_builder} \

From eeca953a5e5caa69a33eb21eda78b38b578c3752 Mon Sep 17 00:00:00 2001
From: lijianguo <lijianguo1991@outlook.com>
Date: Wed, 26 Feb 2025 10:13:54 +0800
Subject: [PATCH 26/41] chore(imagebuilder): podman_publish use dockerfile var
 (#7)

---
 rootfs/imagebuilder/build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rootfs/imagebuilder/build b/rootfs/imagebuilder/build
index 51ab3a4..dbdcdd5 100755
--- a/rootfs/imagebuilder/build
+++ b/rootfs/imagebuilder/build
@@ -37,9 +37,9 @@ function waiting_process {
 }
 
 function podman_publish {
-    local image dryccfile
+    local image dockerfile
     image=$1
-    dryccfile=$2
+    dockerfile=$2
 
     podman_build="podman build . -f ${dockerfile} --tag ${image} --network host"
     podman_push="podman push ${image} --tls-verify=false"

From ad58ddb0aa6836f2e08e2936652d4c8b728fa3bb Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Fri, 28 Mar 2025 14:46:41 +0800
Subject: [PATCH 27/41] chore(imagebuilder): change storage networkpolicy

---
 charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml b/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml
index 6774fe0..4e3b461 100644
--- a/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml
+++ b/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml
@@ -41,7 +41,7 @@ spec:
           kubernetes.io/metadata.name: {{ .Release.Name }}
     - podSelector:
         matchLabels:
-          app: drycc-storage-metanode-weed
+          app: drycc-storage
     ports:
     - protocol: TCP
-      port: 8333
+      port: 9000

From bd58f6a1ea0944dc182f5516c4d57da7aa61fd16 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Thu, 3 Apr 2025 15:37:37 +0800
Subject: [PATCH 28/41] chore(imagebuilder): bump version

---
 rootfs/Dockerfile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index 6802f92..e8191d2 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -5,11 +5,11 @@ ENV DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
   JQ_VERSION="1.7.1" \
-  YQ_VERSION="4.44.6" \
-  PODMAN_VERSION="5.3.1" \
-  MC_VERSION="2024.11.21.17.21.54" \
-  CADDY_VERSION="2.8.4" \
-  PACK_VERSION="0.36.1" \
+  YQ_VERSION="4.45.1" \
+  PODMAN_VERSION="5.4.1" \
+  MC_VERSION="2025.03.12.17.29.24" \
+  CADDY_VERSION="2.9.1" \
+  PACK_VERSION="0.36.4" \
   GOSU_VERSION="1.17"
 
 RUN groupadd drycc --gid ${DRYCC_GID} \

From b471b3b468656e3845e0dc77147574c83945b4cf Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Tue, 8 Apr 2025 11:32:11 +0800
Subject: [PATCH 29/41] chore(mc): bump mc version to 2025.04.03.17.07.56

---
 rootfs/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index e8191d2..580abda 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -7,7 +7,7 @@ ENV DRYCC_UID=1001 \
   JQ_VERSION="1.7.1" \
   YQ_VERSION="4.45.1" \
   PODMAN_VERSION="5.4.1" \
-  MC_VERSION="2025.03.12.17.29.24" \
+  MC_VERSION="2025.04.03.17.07.56" \
   CADDY_VERSION="2.9.1" \
   PACK_VERSION="0.36.4" \
   GOSU_VERSION="1.17"

From 27eb413b72949571047ed94316b07562c4804640 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Tue, 8 Apr 2025 13:56:14 +0800
Subject: [PATCH 30/41] chore(pack): bump pack to 0.37.0

---
 rootfs/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index 580abda..380afdf 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -9,7 +9,7 @@ ENV DRYCC_UID=1001 \
   PODMAN_VERSION="5.4.1" \
   MC_VERSION="2025.04.03.17.07.56" \
   CADDY_VERSION="2.9.1" \
-  PACK_VERSION="0.36.4" \
+  PACK_VERSION="0.37.0" \
   GOSU_VERSION="1.17"
 
 RUN groupadd drycc --gid ${DRYCC_GID} \

From 3fdcd01bef4ff3e211b3924869bb933d27fcb391 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Tue, 8 Apr 2025 14:10:28 +0800
Subject: [PATCH 31/41] chore(podman): bump version to 5.4.2

---
 rootfs/Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index 380afdf..c80efea 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -6,7 +6,7 @@ ENV DRYCC_UID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
   JQ_VERSION="1.7.1" \
   YQ_VERSION="4.45.1" \
-  PODMAN_VERSION="5.4.1" \
+  PODMAN_VERSION="5.4.2" \
   MC_VERSION="2025.04.03.17.07.56" \
   CADDY_VERSION="2.9.1" \
   PACK_VERSION="0.37.0" \

From 9a79e99f1ff0a3270fb10b1b9658dd7df7a43fe1 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Thu, 8 May 2025 13:57:03 +0800
Subject: [PATCH 32/41] chore(storage): add check storage

---
 rootfs/usr/local/bin/get_object | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rootfs/usr/local/bin/get_object b/rootfs/usr/local/bin/get_object
index c6808e9..5ee263d 100755
--- a/rootfs/usr/local/bin/get_object
+++ b/rootfs/usr/local/bin/get_object
@@ -9,4 +9,6 @@ mc config host add storage \
 
 GET_PATH=/tmp/app.tgz
 
+mc ping storage -x
+
 mc cp storage/"${DRYCC_STORAGE_BUCKET}/${TAR_PATH}" "${GET_PATH}"

From 710db910904f4dca9f0fa4a7fc23b4f3c019f000 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Mon, 9 Jun 2025 22:28:26 +0800
Subject: [PATCH 33/41] chore(imagebuilder): change networkpolicy name

---
 charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml b/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml
index 4e3b461..767af80 100644
--- a/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml
+++ b/charts/imagebuilder/templates/imagebuilder-networkpolicy.yaml
@@ -1,7 +1,7 @@
 apiVersion: networking.k8s.io/v1
 kind: NetworkPolicy
 metadata:
-  name: imagebuilder-networkpolicy
+  name: drycc-imagebuilder
 spec:
   podSelector:
     matchLabels:

From 86bd84c0e7d37e0dd7e137cdd72e59e88da24eac Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Mon, 21 Jul 2025 17:44:48 +0800
Subject: [PATCH 34/41] chore(imagebuilder): bump all stack version

---
 rootfs/Dockerfile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index c80efea..8974075 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -5,11 +5,11 @@ ENV DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
   JQ_VERSION="1.7.1" \
-  YQ_VERSION="4.45.1" \
-  PODMAN_VERSION="5.4.2" \
-  MC_VERSION="2025.04.03.17.07.56" \
-  CADDY_VERSION="2.9.1" \
-  PACK_VERSION="0.37.0" \
+  YQ_VERSION="4.46.1" \
+  PODMAN_VERSION="5.5.2" \
+  MC_VERSION="2025.07.16.15.35.03" \
+  CADDY_VERSION="2.10.0" \
+  PACK_VERSION="0.38.2" \
   GOSU_VERSION="1.17"
 
 RUN groupadd drycc --gid ${DRYCC_GID} \

From 438d8f50664ba8781c3e16aaf37c16f48bef5853 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Tue, 22 Jul 2025 10:52:04 +0800
Subject: [PATCH 35/41] chore(storage): use path style replace lookup

---
 rootfs/usr/local/bin/get_object | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/rootfs/usr/local/bin/get_object b/rootfs/usr/local/bin/get_object
index 5ee263d..f0feb35 100755
--- a/rootfs/usr/local/bin/get_object
+++ b/rootfs/usr/local/bin/get_object
@@ -1,11 +1,10 @@
 #!/usr/bin/env bash
 
-mc config host add storage \
+mc alias set storage \
   "${DRYCC_STORAGE_ENDPOINT}" \
   "${DRYCC_STORAGE_ACCESSKEY}" \
   "${DRYCC_STORAGE_SECRETKEY}" \
-  --lookup "${DRYCC_STORAGE_LOOKUP}" \
-  --api s3v4
+  --path "${DRYCC_STORAGE_PATH_STYLE}"
 
 GET_PATH=/tmp/app.tgz
 

From 7e77ed03ff8a0af80c39682976fbab9f4c0adf8d Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Tue, 22 Jul 2025 13:31:09 +0800
Subject: [PATCH 36/41] fix(pack): PACK_VOLUME_KEY is unset

---
 rootfs/imagebuilder/build | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/rootfs/imagebuilder/build b/rootfs/imagebuilder/build
index dbdcdd5..a78d0ee 100755
--- a/rootfs/imagebuilder/build
+++ b/rootfs/imagebuilder/build
@@ -192,6 +192,9 @@ else
             --default-process web \
             --env-file ${envfile} \
             --network host"
+    # fix(pack): PACK_VOLUME_KEY is unset
+    PACK_VOLUME_KEY=${drycc_app}
+    export PACK_VOLUME_KEY
     if [[ $log_level == "debug" ]] ; then
         pack_build="$pack_build --verbose"
     fi

From 4f9b695ade96843649b8beb8bc80e2a58f00949f Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Tue, 2 Sep 2025 14:06:06 +0800
Subject: [PATCH 37/41] fix(shell): check storage ready

---
 rootfs/usr/local/bin/get_object | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/rootfs/usr/local/bin/get_object b/rootfs/usr/local/bin/get_object
index f0feb35..92f8d17 100755
--- a/rootfs/usr/local/bin/get_object
+++ b/rootfs/usr/local/bin/get_object
@@ -9,5 +9,9 @@ mc alias set storage \
 GET_PATH=/tmp/app.tgz
 
 mc ping storage -x
-
+if ! mc admin info storage > /dev/null 2>&1; then
+  sleep 9s
+else
+  mc ready storage
+fi
 mc cp storage/"${DRYCC_STORAGE_BUCKET}/${TAR_PATH}" "${GET_PATH}"

From c8827ddc50c071f473984aaa725508b0e2380fe3 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Sun, 14 Sep 2025 01:11:59 +0800
Subject: [PATCH 38/41] chore(imagebuilder): bump new version

---
 rootfs/Dockerfile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index 8974075..ca58215 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -5,12 +5,12 @@ ENV DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
   JQ_VERSION="1.7.1" \
-  YQ_VERSION="4.46.1" \
-  PODMAN_VERSION="5.5.2" \
-  MC_VERSION="2025.07.16.15.35.03" \
-  CADDY_VERSION="2.10.0" \
+  YQ_VERSION="4.47.2" \
+  PODMAN_VERSION="5.6.1" \
+  MC_VERSION="2025.08.13.08.35.41" \
+  CADDY_VERSION="2.10.2" \
   PACK_VERSION="0.38.2" \
-  GOSU_VERSION="1.17"
+  GOSU_VERSION="1.18"
 
 RUN groupadd drycc --gid ${DRYCC_GID} \
   && useradd drycc -u ${DRYCC_UID} -g ${DRYCC_GID} -s /bin/bash -m -d ${DRYCC_HOME_DIR}

From defafc2d4c9ff5e2ed964be6907deaa3548c7928 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Thu, 18 Sep 2025 09:29:56 +0800
Subject: [PATCH 39/41] chore(charts): bump debian version to trixie

---
 charts/imagebuilder/values.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/charts/imagebuilder/values.yaml b/charts/imagebuilder/values.yaml
index a8061c8..60ec3bc 100644
--- a/charts/imagebuilder/values.yaml
+++ b/charts/imagebuilder/values.yaml
@@ -2,7 +2,7 @@ imageOrg: "drycc"
 imagePullPolicy: "Always"
 imageTag: "canary"
 imageRegistry: "registry.drycc.cc"
-codename: bookworm
+codename: trixie
 containerRegistries: |
   unqualified-search-registries = ["registry.drycc.cc"]
   short-name-mode="permissive"

From 977a6b1f77aa23bc4f365b77869e64ca008dbb1a Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Fri, 17 Oct 2025 14:49:51 +0800
Subject: [PATCH 40/41] chore(imagebuilder): use rclone replace mc

---
 rootfs/Dockerfile               |  6 +++---
 rootfs/usr/local/bin/get_object | 21 +++++++++++----------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index ca58215..2672490 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -1,13 +1,13 @@
 ARG CODENAME
 FROM registry.drycc.cc/drycc/base:${CODENAME}
 
-ENV DRYCC_UID=1001 \
+ARG DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
   JQ_VERSION="1.7.1" \
   YQ_VERSION="4.47.2" \
   PODMAN_VERSION="5.6.1" \
-  MC_VERSION="2025.08.13.08.35.41" \
+  RCLONE_VERSION="1.71.1" \
   CADDY_VERSION="2.10.2" \
   PACK_VERSION="0.38.2" \
   GOSU_VERSION="1.18"
@@ -21,7 +21,7 @@ RUN install-packages procps psmisc \
   && install-stack jq $JQ_VERSION \
   && install-stack yq $YQ_VERSION \
   && install-stack podman $PODMAN_VERSION \
-  && install-stack mc $MC_VERSION \
+  && install-stack rclone $RCLONE_VERSION \
   && install-stack caddy $CADDY_VERSION \
   && install-stack pack $PACK_VERSION \
   && install-stack gosu $GOSU_VERSION \
diff --git a/rootfs/usr/local/bin/get_object b/rootfs/usr/local/bin/get_object
index 92f8d17..6f0a3ac 100755
--- a/rootfs/usr/local/bin/get_object
+++ b/rootfs/usr/local/bin/get_object
@@ -1,17 +1,18 @@
 #!/usr/bin/env bash
 
-mc alias set storage \
-  "${DRYCC_STORAGE_ENDPOINT}" \
-  "${DRYCC_STORAGE_ACCESSKEY}" \
-  "${DRYCC_STORAGE_SECRETKEY}" \
-  --path "${DRYCC_STORAGE_PATH_STYLE}"
+mkdir -p ~/.config/rclone
+touch ~/.config/rclone/rclone.conf
+rclone config create storage s3 \
+  provider=Other \
+  access_key_id="${DRYCC_STORAGE_ACCESSKEY}" \
+  secret_access_key="${DRYCC_STORAGE_SECRETKEY}" \
+  endpoint="${DRYCC_STORAGE_ENDPOINT}" \
+  force_path_style="${DRYCC_STORAGE_PATH_STYLE:-true}" --no-output
 
 GET_PATH=/tmp/app.tgz
 
-mc ping storage -x
-if ! mc admin info storage > /dev/null 2>&1; then
+if ! rclone lsd storage: > /dev/null 2>&1; then
   sleep 9s
-else
-  mc ready storage
+  echo "waiting for object storage to become ready..."
 fi
-mc cp storage/"${DRYCC_STORAGE_BUCKET}/${TAR_PATH}" "${GET_PATH}"
+rclone copyto storage:"${DRYCC_STORAGE_BUCKET}/${TAR_PATH}" "${GET_PATH}"

From 65dc12ab98e0a9236d381680572893b0273c1097 Mon Sep 17 00:00:00 2001
From: duanhongyi <duanhongyi@doopai.com>
Date: Sat, 15 Nov 2025 21:23:57 +0800
Subject: [PATCH 41/41] chore(podman): bump version to 5.7.0

---
 rootfs/Dockerfile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile
index 2672490..e14ea5d 100644
--- a/rootfs/Dockerfile
+++ b/rootfs/Dockerfile
@@ -5,12 +5,12 @@ ARG DRYCC_UID=1001 \
   DRYCC_GID=1001 \
   DRYCC_HOME_DIR=/home/drycc \
   JQ_VERSION="1.7.1" \
-  YQ_VERSION="4.47.2" \
-  PODMAN_VERSION="5.6.1" \
-  RCLONE_VERSION="1.71.1" \
+  YQ_VERSION="4.48.1" \
+  PODMAN_VERSION="5.7.0" \
+  RCLONE_VERSION="1.71.2" \
   CADDY_VERSION="2.10.2" \
   PACK_VERSION="0.38.2" \
-  GOSU_VERSION="1.18"
+  GOSU_VERSION="1.19"
 
 RUN groupadd drycc --gid ${DRYCC_GID} \
   && useradd drycc -u ${DRYCC_UID} -g ${DRYCC_GID} -s /bin/bash -m -d ${DRYCC_HOME_DIR}
