From 7b03e1d81f9cabdfd68daff3d359ebc521c55c78 Mon Sep 17 00:00:00 2001 From: Yajith Dayarathna Date: Thu, 19 Sep 2024 16:30:33 +1200 Subject: [PATCH 1/7] fixing typo and other improvements --- .github/workflows/dev.workflow.yaml | 16 ++++++++-------- build/build_and_push.sh | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dev.workflow.yaml b/.github/workflows/dev.workflow.yaml index 0ec61e6..f5124e7 100644 --- a/.github/workflows/dev.workflow.yaml +++ b/.github/workflows/dev.workflow.yaml @@ -18,29 +18,29 @@ jobs: steps: - name: checkout code uses: actions/checkout@v2 - # https://github.com/docker/setup-qemu-action + - name: "[preparation] set up golang" uses: actions/setup-go@v5.0.0 with: go-version-file: go.mod + - name: Set up QEMU uses: docker/setup-qemu-action@v1 - # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 with: - driver-opts: image=moby/buildkit:v0.10.6 - - uses: actions/setup-go@v3 - with: - go-version: "1.22.5" + driver-opts: image=moby/buildkit:v0.16.0 + - name: login to docker hub run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - - name: build the image to portainer ci with PR number + - name: "build the image to portainer ci with PR number (portainerci/portainer-updater:pr$GITHUB_PR_NUMBER)" if: ${{ github.event.pull_request.number != '' }} run: | "${GITHUB_WORKSPACE}/build/build_and_push.sh" portainerci pr$GITHUB_PR_NUMBER - - name: build the image to portainer ci ( Develop Latest ) + + - name: "build the image to portainer ci (portainerci/portainer-updater:develop)" if: ${{ github.ref == 'refs/heads/develop' }} run: | "${GITHUB_WORKSPACE}/build/build_and_push.sh" portainerci develop diff --git a/build/build_and_push.sh b/build/build_and_push.sh index 8076ac3..5546cdc 100755 --- a/build/build_and_push.sh +++ b/build/build_and_push.sh @@ -32,7 +32,7 @@ docker_image_build_and_push() build_args+=(--build-arg OSVERSION=1809) fi - docker buildx build --push -f ${dockerfile} "${build_args[@]}" --platform "${os}/${arch}" --tag "${repo}:${tag}-${os}-${arch}" . + docker buildx build --push -f ${dockerfile} "${build_args[@]}" --attest type=sbom,generator=docker/scout-sbom-indexer:latest --attest type=provenance,mode=max --platform "${os}/${arch}" --tag "${repo}:${tag}-${os}-${arch}" . } docker_manifest_create_and_push() From 7dc6499c4bf936953d90c219a1923cfb87bfe477 Mon Sep 17 00:00:00 2001 From: Yajith Dayarathna Date: Thu, 19 Sep 2024 16:38:05 +1200 Subject: [PATCH 2/7] testing --- .github/workflows/dev.workflow.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.workflow.yaml b/.github/workflows/dev.workflow.yaml index f5124e7..7fea2a0 100644 --- a/.github/workflows/dev.workflow.yaml +++ b/.github/workflows/dev.workflow.yaml @@ -30,12 +30,12 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 with: - driver-opts: image=moby/buildkit:v0.16.0 + driver-opts: image=moby/buildkit:v0.10.6 - name: login to docker hub run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - - name: "build the image to portainer ci with PR number (portainerci/portainer-updater:pr$GITHUB_PR_NUMBER)" + - name: "build the image to portainer ci with PR number (portainerci/portainer-updater:pr${{ github.event.pull_request.number }})" if: ${{ github.event.pull_request.number != '' }} run: | "${GITHUB_WORKSPACE}/build/build_and_push.sh" portainerci pr$GITHUB_PR_NUMBER From 2bc3c06de80b73bdabd96fe81399c633a35ba87f Mon Sep 17 00:00:00 2001 From: Yajith Dayarathna Date: Thu, 19 Sep 2024 16:45:04 +1200 Subject: [PATCH 3/7] testing --- .github/workflows/dev.workflow.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dev.workflow.yaml b/.github/workflows/dev.workflow.yaml index 7fea2a0..8d88866 100644 --- a/.github/workflows/dev.workflow.yaml +++ b/.github/workflows/dev.workflow.yaml @@ -16,19 +16,19 @@ jobs: environment: name: staging steps: - - name: checkout code - uses: actions/checkout@v2 + - name: "[preparation] checkout" + uses: actions/checkout@v4.1.1 - name: "[preparation] set up golang" uses: actions/setup-go@v5.0.0 with: go-version-file: go.mod - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + - name: "[preparation] set up qemu" + uses: docker/setup-qemu-action@v3.2.0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3.6.1 with: driver-opts: image=moby/buildkit:v0.10.6 From 3adfcb76610e74faabd6c521c7c7e52715dfa99d Mon Sep 17 00:00:00 2001 From: Yajith Dayarathna Date: Thu, 19 Sep 2024 16:47:32 +1200 Subject: [PATCH 4/7] testing --- .github/workflows/dev.workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.workflow.yaml b/.github/workflows/dev.workflow.yaml index 8d88866..6a112b8 100644 --- a/.github/workflows/dev.workflow.yaml +++ b/.github/workflows/dev.workflow.yaml @@ -30,7 +30,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.6.1 with: - driver-opts: image=moby/buildkit:v0.10.6 + driver-opts: image=moby/buildkit:v0.16.0 - name: login to docker hub run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin From 16369f42d555798a4a60342e1ca9a6365df7ede1 Mon Sep 17 00:00:00 2001 From: Yajith Dayarathna Date: Thu, 19 Sep 2024 16:52:14 +1200 Subject: [PATCH 5/7] testing --- build/build_and_push.sh | 2 +- build/linux/Dockerfile | 2 +- build/windows/Dockerfile | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/build_and_push.sh b/build/build_and_push.sh index 5546cdc..8076ac3 100755 --- a/build/build_and_push.sh +++ b/build/build_and_push.sh @@ -32,7 +32,7 @@ docker_image_build_and_push() build_args+=(--build-arg OSVERSION=1809) fi - docker buildx build --push -f ${dockerfile} "${build_args[@]}" --attest type=sbom,generator=docker/scout-sbom-indexer:latest --attest type=provenance,mode=max --platform "${os}/${arch}" --tag "${repo}:${tag}-${os}-${arch}" . + docker buildx build --push -f ${dockerfile} "${build_args[@]}" --platform "${os}/${arch}" --tag "${repo}:${tag}-${os}-${arch}" . } docker_manifest_create_and_push() diff --git a/build/linux/Dockerfile b/build/linux/Dockerfile index 55166c9..1eb65e9 100644 --- a/build/linux/Dockerfile +++ b/build/linux/Dockerfile @@ -1,6 +1,6 @@ ARG GIT_COMMIT=unspecified -FROM alpine:3.6 as base +FROM alpine:3.6 AS base RUN apk add -U --no-cache ca-certificates diff --git a/build/windows/Dockerfile b/build/windows/Dockerfile index 7f23a4a..60f42cf 100644 --- a/build/windows/Dockerfile +++ b/build/windows/Dockerfile @@ -1,7 +1,7 @@ ARG GIT_COMMIT=unspecified ARG OSVERSION -FROM --platform=linux/amd64 gcr.io/k8s-staging-e2e-test-images/windows-servercore-cache:1.0-linux-amd64-${OSVERSION} as core -FROM --platform=linux/amd64 alpine:3.13.0 as downloader +FROM --platform=linux/amd64 gcr.io/k8s-staging-e2e-test-images/windows-servercore-cache:1.0-linux-amd64-${OSVERSION} AS core +FROM --platform=linux/amd64 alpine:3.13.0 AS downloader ENV GIT_VERSION 2.46.0 ENV GIT_PATCH_VERSION 1 From 490fd6367cd61afdccfbf0ff1f998f5beb85f2cb Mon Sep 17 00:00:00 2001 From: Yajith Dayarathna Date: Thu, 19 Sep 2024 16:59:17 +1200 Subject: [PATCH 6/7] testing --- .github/workflows/dev.workflow.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.workflow.yaml b/.github/workflows/dev.workflow.yaml index 6a112b8..8d88866 100644 --- a/.github/workflows/dev.workflow.yaml +++ b/.github/workflows/dev.workflow.yaml @@ -30,7 +30,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.6.1 with: - driver-opts: image=moby/buildkit:v0.16.0 + driver-opts: image=moby/buildkit:v0.10.6 - name: login to docker hub run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin From 80a60dd628f86d7d7ede77102e3df8d78ddd57ec Mon Sep 17 00:00:00 2001 From: Yajith Dayarathna Date: Thu, 19 Sep 2024 17:08:14 +1200 Subject: [PATCH 7/7] updating Dockerfile --- build/linux/Dockerfile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/build/linux/Dockerfile b/build/linux/Dockerfile index 1eb65e9..a5941b4 100644 --- a/build/linux/Dockerfile +++ b/build/linux/Dockerfile @@ -1,14 +1,8 @@ ARG GIT_COMMIT=unspecified - -FROM alpine:3.6 AS base -RUN apk add -U --no-cache ca-certificates - - -FROM scratch +FROM portainer/base:latest LABEL git_commit=$GIT_COMMIT -COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY dist / ENTRYPOINT [ "/portainer-updater" ] \ No newline at end of file