Skip to content

Commit d27d75d

Browse files
committed
[lwpm] sync support oci
Signed-off-by: Kang Huaishuai <khs1994@khs1994.com>
1 parent cf791ea commit d27d75d

File tree

4 files changed

+21
-14
lines changed

4 files changed

+21
-14
lines changed

dockerfile/php/.github/workflows/php_8_4.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ jobs:
113113
if [ "$TYPE" = "ZTS" ];then
114114
echo ::group::Build $TYPE
115115
docker buildx build $options \
116+
--secret id=github-token,env=GITHUB_TOKEN \
116117
--build-arg ALPINE_URL=${ALPINE_URL:-dl-cdn.alpinelinux.org} \
117118
-t $DOCKER_HUB_USERNAME/php:${PHP_TAG_VERSION}-frankenphp-alpine \
118119
$(for item in `echo $mirror`;do echo " -t ${item}:${PHP_TAG_VERSION}-frankenphp-alpine ";done) \

dockerfile/php/8.4/zts/Dockerfile

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,11 @@ LABEL org.opencontainers.image.revision=$VCS_REF \
450450

451451
ENV GODEBUG=cgocheck=0
452452

453-
ARG FRANKENPHP_VERSION='v1.7.0'
453+
ARG FRANKENPHP_VERSION='v1.9.0'
454454

455455
RUN --mount=type=bind,from=go,source=/usr/local/go,target=/usr/local/go,rw \
456456
--mount=type=cache,target=/root/go,rw \
457+
--mount=type=secret,id=github-token \
457458
set -x \
458459
&& apk add --no-cache \
459460
# ca-certificates \
@@ -490,16 +491,20 @@ RUN --mount=type=bind,from=go,source=/usr/local/go,target=/usr/local/go,rw \
490491
&& export GOTOOLCHAIN=local \
491492
&& mkdir -p /usr/local/src/watcher \
492493
&& cd /usr/local/src/watcher \
493-
&& curl -s https://api.github.com/repos/e-dant/watcher/releases/latest | \
494-
grep tarball_url | \
495-
awk '{ print $2 }' | \
496-
sed 's/,$//' | \
497-
sed 's/"//g' | \
498-
xargs curl -L | \
499-
tar xz --strip-components 1 && \
500-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \
501-
cmake --build build && \
502-
cmake --install build \
494+
&& if [ -f /run/secrets/github-token ] && [ -s /run/secrets/github-token ]; then \
495+
curl -s -H "Authorization: Bearer $(cat /run/secrets/github-token)" https://api.github.com/repos/e-dant/watcher/releases/latest; \
496+
else \
497+
curl -s https://api.github.com/repos/e-dant/watcher/releases/latest; \
498+
fi | \
499+
grep tarball_url | \
500+
awk '{ print $2 }' | \
501+
sed 's/,$//' | \
502+
sed 's/"//g' | \
503+
xargs curl -L | \
504+
tar xz --strip-components 1 && \
505+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && \
506+
cmake --build build && \
507+
cmake --install build \
503508
&& cd /go/src/app \
504509
&& go mod download \
505510
&& cd /go/src/app/caddy \
@@ -509,7 +514,8 @@ RUN --mount=type=bind,from=go,source=/usr/local/go,target=/usr/local/go,rw \
509514
&& export CGO_CPPFLAGS=$PHP_CPPFLAGS \
510515
&& export CGO_LDFLAGS="-lssl -lcrypto -lreadline -largon2 -lcurl -lonig -lz $PHP_LDFLAGS" \
511516
&& cd /go/src/app/caddy/frankenphp \
512-
&& GOBIN=/usr/local/bin go install -tags 'nobadger,nomysql,nopgx' -ldflags "-w -s -extldflags '-Wl,-z,stack-size=0x80000' -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION PHP $PHP_VERSION Caddy'" -buildvcs=true && \
517+
&& GOBIN=/usr/local/bin \
518+
../../go.sh install -ldflags "-w -s -extldflags '-Wl,-z,stack-size=0x80000' -X 'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP $FRANKENPHP_VERSION PHP $PHP_VERSION Caddy'" -buildvcs=true && \
513519
setcap cap_net_bind_service=+ep /usr/local/bin/frankenphp && \
514520
([ -z "${NO_COMPRESS}" ] && upx --best /usr/local/bin/frankenphp || true) && \
515521
frankenphp version && \

windows/docker-image-sync.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ Function _sync($source, $dest, $config) {
271271

272272
# try oci manifest list
273273
$manifest_list_json_path = Get-Manifest $token $source_image $source_ref -raw $false `
274-
-registry $source_registry -header [OCIImageSpec]::manifest_list
274+
-registry $source_registry -header $([OCIImageSpec]::manifest_list)
275275

276276
if ($manifest_list_json_path) {
277277
$oci_manifest_list = $true

windows/sdk/dockerhub/manifests/get.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Import-Module $PSScriptRoot/../cache/cache.psm1
55
function Get-Manifest([string]$token, [string]$image, $ref, $header, $registry = "registry.hub.docker.com", $raw = $true, $return_digest_only = $false) {
66
if (!$header) { $header = [DockerImageSpec]::manifest_list }
77

8-
$type = "manifest"
8+
$type = "docker manifest"
99

1010
if ($header -eq [DockerImageSpec]::manifest_list) { $type = "docker manifest list" }
1111
if ($header -eq [OCIImageSpec]::manifest_list) { $type = "oci manifest list" }

0 commit comments

Comments
 (0)