├── version ├── .gitignore ├── .gitmodules ├── .github ├── dependabot.yml └── workflows │ └── docker-publish-images.yml ├── README.md └── justfile /version: -------------------------------------------------------------------------------- 1 | v2.14.0 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | charts/ 2 | .idea/ 3 | .DS_Store -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "harbor"] 2 | path = harbor 3 | url = https://github.com/goharbor/harbor 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | 8 | - package-ecosystem: "gitsubmodule" 9 | directory: "/" 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Harbor multi-arch images 2 | 3 | ## How to build 4 | 5 | Same as https://github.com/goharbor/harbor 6 | With the patch https://github.com/goharbor/harbor/compare/v2.13.2...morlay:patch-v2.13.2 7 | 8 | See more in https://github.com/octohelm/harbor/blob/main/.github/workflows/docker-publish-images.yml -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | export VERSION := `cat version` 2 | 3 | all: dep patch 4 | 5 | dep: 6 | git submodule update --init --recursive 7 | git submodule update --force --remote 8 | git submodule foreach -q --recursive 'git reset --hard && git checkout ${VERSION}' 9 | 10 | [working-directory('harbor')] 11 | patch: 12 | curl "https://github.com/goharbor/harbor/compare/{{ VERSION }}...morlay:patch-{{ VERSION }}.patch" | git apply -v 13 | 14 | [working-directory('harbor')] 15 | reset: 16 | git add . 17 | git reset --hard 18 | -------------------------------------------------------------------------------- /.github/workflows/docker-publish-images.yml: -------------------------------------------------------------------------------- 1 | name: Docker publish 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'main' 7 | 8 | jobs: 9 | docker-base-image: 10 | runs-on: ubuntu-latest 11 | strategy: 12 | matrix: 13 | component: 14 | - trivy-adapter 15 | - core 16 | - db 17 | - exporter 18 | - jobservice 19 | - log 20 | - nginx 21 | - portal 22 | - prepare 23 | - redis 24 | - registry 25 | - registryctl 26 | 27 | defaults: 28 | run: 29 | working-directory: ./harbor 30 | 31 | steps: 32 | - uses: extractions/setup-just@v3 33 | - uses: actions/checkout@v4 34 | with: 35 | submodules: true 36 | 37 | - uses: docker/setup-qemu-action@v3 38 | - uses: docker/setup-buildx-action@v3 39 | with: 40 | driver: docker-container 41 | driver-opts: network=host 42 | - uses: docker/login-action@v3 43 | with: 44 | registry: ghcr.io 45 | username: ${{ github.actor }} 46 | password: ${{ secrets.GITHUB_TOKEN }} 47 | 48 | - run: cd .. && just patch 49 | 50 | - id: prepare 51 | run: echo "tag=$(cat ../version)" >> $GITHUB_ENV 52 | 53 | - name: Build base image 54 | uses: docker/build-push-action@v6 55 | with: 56 | context: ./harbor 57 | file: ./harbor/make/photon/${{ matrix.component }}/Dockerfile.base 58 | platforms: linux/amd64,linux/arm64 59 | labels: | 60 | org.opencontainers.image.source=https://github.com/${{ github.repository }} 61 | org.opencontainers.image.revision=${{ env.tag }} 62 | push: ${{ github.event_name != 'pull_request' }} 63 | tags: ghcr.io/${{ github.repository }}/harbor-${{ matrix.component }}-base:${{ env.tag }} 64 | 65 | docker-image: 66 | needs: 67 | - docker-base-image 68 | 69 | runs-on: ubuntu-latest 70 | 71 | strategy: 72 | fail-fast: false 73 | matrix: 74 | component: 75 | - prepare 76 | - db 77 | - portal 78 | - core 79 | - jobservice 80 | - log 81 | - nginx 82 | - registryctl 83 | - trivy_adapter 84 | - redis 85 | - standalone_db_migrator 86 | - exporter 87 | 88 | defaults: 89 | run: 90 | working-directory: ./harbor 91 | 92 | steps: 93 | - uses: extractions/setup-just@v3 94 | - uses: actions/checkout@v4 95 | with: 96 | submodules: true 97 | 98 | - uses: actions/setup-go@v3 99 | with: 100 | go-version: '^1.x' 101 | 102 | - uses: docker/setup-qemu-action@v3 103 | - uses: docker/setup-buildx-action@v3 104 | with: 105 | driver: docker-container 106 | driver-opts: network=host 107 | 108 | - run: cd .. && just patch 109 | 110 | - uses: docker/login-action@v3 111 | with: 112 | registry: ghcr.io 113 | username: ${{ github.actor }} 114 | password: ${{ secrets.GITHUB_TOKEN }} 115 | 116 | - id: prepare 117 | run: echo "tag=$(cat ../version)" >> $GITHUB_ENV 118 | 119 | - name: Build & Publish images 120 | env: 121 | IMAGENAMESPACE: ghcr.io/${{ github.repository }} 122 | BASEIMAGENAMESPACE: ghcr.io/${{ github.repository }} 123 | IMAGELABELS: org.opencontainers.image.source=https://github.com/${{ github.repository }} 124 | MULTIARCH: true 125 | TRIVYFLAG: true 126 | CHARTFLAG: true 127 | NOTARYFLAG: true 128 | run: | 129 | set -eux; 130 | 131 | CTX="BUILDBIN=true VERSIONTAG=${{ env.tag }} BASEIMAGETAG=${{ env.tag }} MULTIARCH=${MULTIARCH} IMAGENAMESPACE=${IMAGENAMESPACE} BASEIMAGENAMESPACE=${BASEIMAGENAMESPACE} TRIVYFLAG=${TRIVYFLAG} CHARTFLAG=${CHARTFLAG} NOTARYFLAG=${CHARTFLAG} IMAGELABELS=${IMAGELABELS}" 132 | 133 | make versions_prepare ${CTX}; 134 | 135 | case ${{ matrix.component }} in 136 | core) make compile_core ${CTX} ;; 137 | jobservice) make compile_jobservice ${CTX};; 138 | registryctl) make compile_registryctl ${CTX};; 139 | standalone_db_migrator) make compile_standalone_db_migrator ${CTX} ;; 140 | esac; 141 | 142 | case ${{ matrix.component }} in 143 | exporter) make build BUILDTARGET="_compile_and_build_exporter" ${CTX} ;; 144 | registryctl) make build BUILDTARGET="_build_registry _build_registryctl" ${CTX} ;; 145 | *) make build BUILDTARGET="_build_${{ matrix.component }}" ${CTX} ;; 146 | esac; 147 | --------------------------------------------------------------------------------