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 01/25] 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 02/25] 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 03/25] 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 04/25] 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 05/25] 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 06/25] 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 07/25] 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 08/25] 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 09/25] 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 10/25] 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 11/25] 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 12/25] 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 13/25] 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 14/25] 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 15/25] 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 16/25] 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 17/25] 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 18/25] 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 19/25] 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 20/25] 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 21/25] 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 22/25] 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 23/25] 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 24/25] 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 25/25] 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}
