Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore/update ci #716

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: docker/[email protected]
with:
endpoint: builders
driver-opts: image=moby/buildkit:v0.13.2
# driver-opts: image=moby/buildkit:v0.10.6
- name: "[preparation] docker login"
uses: docker/[email protected]
with:
Expand Down Expand Up @@ -84,10 +84,10 @@ jobs:
- name: "[execution] build and push docker images"
run: |
if [ "${{ matrix.config.platform }}" == "windows" ]; then
docker buildx build --output=type=registry --attest type=provenance,mode=max --attest type=sbom,disabled=false --platform ${{ matrix.config.platform }}/${{ matrix.config.arch }} --build-arg OSVERSION=${{ matrix.config.version }} -t "${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}" -f build/${{ matrix.config.platform }}/Dockerfile .
docker buildx build --output=type=registry --platform ${{ matrix.config.platform }}/${{ matrix.config.arch }} --build-arg OSVERSION=${{ matrix.config.version }} -t "${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}" -f build/${{ matrix.config.platform }}/Dockerfile .
else
docker buildx build --output=type=registry --attest type=provenance,mode=max --attest type=sbom,disabled=false --platform ${{ matrix.config.platform }}/${{ matrix.config.arch }} -t "${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}" -f build/${{ matrix.config.platform }}/Dockerfile .
docker buildx build --output=type=registry --attest type=provenance,mode=max --attest type=sbom,disabled=false --platform ${{ matrix.config.platform }}/${{ matrix.config.arch }} -t "${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-alpine" -f build/${{ matrix.config.platform }}/alpine.Dockerfile .
docker buildx build --output=type=registry --platform ${{ matrix.config.platform }}/${{ matrix.config.arch }} -t "${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}" -f build/${{ matrix.config.platform }}/Dockerfile .
docker buildx build --output=type=registry --platform ${{ matrix.config.platform }}/${{ matrix.config.arch }} -t "${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-alpine" -f build/${{ matrix.config.platform }}/alpine.Dockerfile .
fi
env:
CONTAINER_IMAGE_TAG: ${{ env.CONTAINER_IMAGE_TAG }}
Expand Down Expand Up @@ -123,15 +123,19 @@ jobs:
CONTAINER_IMAGE_TAG=$(echo $GITHUB_REF_NAME | sed 's/\//-/g')
fi

docker buildx imagetools create -t "${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}" \
docker manifest create "${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}" \
"${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-linux-amd64" \
"${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-linux-arm64" \
"${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-linux-arm" \
"${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-linux-ppc64le" \
"${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-windows1809-amd64" \
"${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-windowsltsc2022-amd64"

docker buildx imagetools create -t "${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-alpine" \
docker manifest push "${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}"

docker manifest create "${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-alpine" \
"${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-linux-amd64-alpine" \
"${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-linux-arm64-alpine" \
"${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-linux-arm-alpine"

docker manifest push "${DOCKER_HUB_REPO}:${CONTAINER_IMAGE_TAG}-alpine"
16 changes: 8 additions & 8 deletions build/windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ FROM --platform=linux/amd64 gcr.io/k8s-staging-e2e-test-images/windows-servercor
FROM mcr.microsoft.com/windows/nanoserver:${OSVERSION}
ENV PATH="C:\mingit\cmd;C:\app;C:\Windows\system32;C:\Windows;"

COPY --from=core /Windows/System32/netapi32.dll /Windows/System32/netapi32.dll
COPY --from=core /Windows/System32/netapi32.dll C:/Windows/System32/netapi32.dll

USER ContainerAdministrator

COPY dist/mingit/ mingit/
COPY dist/agent.exe /app/
COPY dist/docker.exe /app/
COPY dist/docker-compose.exe /app/
COPY dist/docker-credential-portainer.exe /app/
COPY dist/kubectl.exe /app/
COPY dist/mingit/ C:/mingit/
COPY dist/agent.exe C:/app/
COPY dist/docker.exe C:/app/
COPY dist/docker-compose.exe C:/app/
COPY dist/docker-credential-portainer.exe C:/app/
COPY dist/kubectl.exe C:/app/

COPY static /app/static
# COPY static/ C:/app/static
COPY config /Users/ContainerAdministrator/.docker/

LABEL io.portainer.agent=true
Expand Down
Loading