diff --git a/.github/workflows/coolify-builder.yml b/.github/workflows/coolify-builder.yml index 6fa1a82a5..b428005c5 100644 --- a/.github/workflows/coolify-builder.yml +++ b/.github/workflows/coolify-builder.yml @@ -2,14 +2,14 @@ name: Coolify Builder (v4) on: push: - branches: ["this-does-not-exist"] + branches: ["v4"] env: REGISTRY: ghcr.io IMAGE_NAME: "coollabsio/coolify-builder" jobs: - build: + amd64: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -28,3 +28,41 @@ jobs: platforms: linux/amd64 push: true tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + aarch64: + runs-on: [self-hosted, arm64] + steps: + - uses: actions/checkout@v3 + - name: Login to ghcr.io + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build image and push to registry + uses: docker/build-push-action@v3 + with: + no-cache: true + context: . + file: docker/coolify-builder/Dockerfile + platforms: linux/aarch64 + push: true + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:aarch64 + merge-manifest: + runs-on: ubuntu-latest + needs: [amd64, aarch64] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to ghcr.io + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Create & publish manifest + run: | + docker buildx imagetools create --append ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:aarch64 --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \ No newline at end of file diff --git a/docker/coolify-builder/Dockerfile b/docker/coolify-builder/Dockerfile index fedfc417b..d03e0196c 100644 --- a/docker/coolify-builder/Dockerfile +++ b/docker/coolify-builder/Dockerfile @@ -24,7 +24,15 @@ RUN if [[ ${TARGETPLATFORM} == 'linux/amd64' ]]; then \ curl -sSL https://nixpacks.com/install.sh | bash && \ chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/pack /root/.docker/cli-plugins/docker-buildx \ ;fi -RUN + +RUN if [[ ${TARGETPLATFORM} == 'linux/arm64' ]]; then \ + curl -sSL https://github.com/docker/buildx/releases/download/v${DOCKER_BUILDX_VERSION}/buildx-v${DOCKER_BUILDX_VERSION}.linux-arm64 -o ~/.docker/cli-plugins/docker-buildx && \ + curl -sSL https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-linux-aarch64 -o ~/.docker/cli-plugins/docker-compose && \ + (curl -sSL https://download.docker.com/linux/static/stable/aarch64/docker-${DOCKER_VERSION}.tgz | tar -C /usr/bin/ --no-same-owner -xzv --strip-components=1 docker/docker) && \ + (curl -sSL https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux-arm64.tgz | tar -C /usr/local/bin/ --no-same-owner -xzv pack) && \ + curl -sSL https://nixpacks.com/install.sh | bash && \ + chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/pack /root/.docker/cli-plugins/docker-buildx \ + ;fi ENTRYPOINT ["/sbin/tini", "--"] CMD ["sh", "-c", "while true; do sleep 3600 && exit 0; done"]