diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4a85cda --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Release + +on: + push: + branches: [ main ] + workflow_dispatch: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Log into registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + registry: docker.io + username: virtualzone + password: ${{ secrets.CI_REGISTRY_PASSWORD }} + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 + push: true + tags: | + virtualzone/docker-container-stats:latest + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new + - name: Docker Hub Description + uses: peter-evans/dockerhub-description@v2 + with: + username: virtualzone + password: ${{ secrets.CI_REGISTRY_PASSWORD }} + repository: virtualzone/docker-container-stats + readme-filepath: ./README.md \ No newline at end of file diff --git a/Dockerfile.arm32v6 b/Dockerfile.arm32v6 deleted file mode 100644 index 7d18a25..0000000 --- a/Dockerfile.arm32v6 +++ /dev/null @@ -1,38 +0,0 @@ -FROM alpine:3.16 AS qemu -RUN apk --update add --no-cache curl -RUN cd /tmp && \ - curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-arm/qemu-arm-static . - -FROM arm32v6/alpine:3.16 -COPY --from=qemu /tmp/qemu-arm-static /usr/bin/ -ARG BUILD_DATE -ARG VCS_REF -LABEL org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="Docker Container Stats" \ - org.label-schema.description="Monitor your docker containers with this web interface." \ - org.label-schema.vcs-ref=$VCS_REF \ - org.label-schema.vcs-url="https://github.com/virtualzone/docker-container-stats" \ - org.label-schema.schema-version="1.0" - -RUN apk --update add --no-cache \ - supervisor \ - nodejs \ - npm \ - docker \ - sqlite - -RUN mkdir -p /opt/docker-stats/db -RUN apk --update add --no-cache --virtual .build-deps \ - make python2 gcc g++ libc-dev && \ - cd /opt/docker-stats && \ - npm update && \ - npm install express sqlite3 body-parser moment --build-from-source=sqlite3 && \ - apk del .build-deps - -ADD stats.js /opt/docker-stats/ -ADD httpd.js /opt/docker-stats/ -ADD html/ /opt/docker-stats/html/ -ADD supervisord.conf /etc/supervisord.conf - -EXPOSE 8080 -CMD ["/usr/bin/supervisord"] \ No newline at end of file diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 deleted file mode 100644 index 96b27b3..0000000 --- a/Dockerfile.arm32v7 +++ /dev/null @@ -1,38 +0,0 @@ -FROM alpine:3.16 AS qemu -RUN apk --update add --no-cache curl -RUN cd /tmp && \ - curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-arm/qemu-arm-static . - -FROM arm32v7/alpine:3.16 -COPY --from=qemu /tmp/qemu-arm-static /usr/bin/ -ARG BUILD_DATE -ARG VCS_REF -LABEL org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="Docker Container Stats" \ - org.label-schema.description="Monitor your docker containers with this web interface." \ - org.label-schema.vcs-ref=$VCS_REF \ - org.label-schema.vcs-url="https://github.com/virtualzone/docker-container-stats" \ - org.label-schema.schema-version="1.0" - -RUN apk --update add --no-cache \ - supervisor \ - nodejs \ - npm \ - docker \ - sqlite - -RUN mkdir -p /opt/docker-stats/db -RUN apk --update add --no-cache --virtual .build-deps \ - make python2 gcc g++ libc-dev && \ - cd /opt/docker-stats && \ - npm update && \ - npm install express sqlite3 body-parser moment --build-from-source=sqlite3 && \ - apk del .build-deps - -ADD stats.js /opt/docker-stats/ -ADD httpd.js /opt/docker-stats/ -ADD html/ /opt/docker-stats/html/ -ADD supervisord.conf /etc/supervisord.conf - -EXPOSE 8080 -CMD ["/usr/bin/supervisord"] \ No newline at end of file diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 deleted file mode 100644 index 9e7010d..0000000 --- a/Dockerfile.arm64v8 +++ /dev/null @@ -1,38 +0,0 @@ -FROM alpine:3.16 AS qemu -RUN apk --update add --no-cache curl -RUN cd /tmp && \ - curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-aarch64.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-aarch64/qemu-aarch64-static . - -FROM arm64v8/alpine:3.16 -COPY --from=qemu /tmp/qemu-aarch64-static /usr/bin/ -ARG BUILD_DATE -ARG VCS_REF -LABEL org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="Docker Container Stats" \ - org.label-schema.description="Monitor your docker containers with this web interface." \ - org.label-schema.vcs-ref=$VCS_REF \ - org.label-schema.vcs-url="https://github.com/virtualzone/docker-container-stats" \ - org.label-schema.schema-version="1.0" - -RUN apk --update add --no-cache \ - supervisor \ - nodejs \ - npm \ - docker \ - sqlite - -RUN mkdir -p /opt/docker-stats/db -RUN apk --update add --no-cache --virtual .build-deps \ - make python2 gcc g++ libc-dev && \ - cd /opt/docker-stats && \ - npm update && \ - npm install express sqlite3 body-parser moment --build-from-source=sqlite3 && \ - apk del .build-deps - -ADD stats.js /opt/docker-stats/ -ADD httpd.js /opt/docker-stats/ -ADD html/ /opt/docker-stats/html/ -ADD supervisord.conf /etc/supervisord.conf - -EXPOSE 8080 -CMD ["/usr/bin/supervisord"] \ No newline at end of file diff --git a/hooks/build b/hooks/build deleted file mode 100755 index 8757e61..0000000 --- a/hooks/build +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -docker build \ - --file "${DOCKERFILE_PATH}" \ - --build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \ - --build-arg VCS_REF="$(git rev-parse --short HEAD)" \ - --tag "$IMAGE_NAME" \ - . \ No newline at end of file diff --git a/hooks/post_push b/hooks/post_push deleted file mode 100755 index 9f54ac5..0000000 --- a/hooks/post_push +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -curl -Lo manifest-tool https://github.com/estesp/manifest-tool/releases/download/v1.0.0/manifest-tool-linux-amd64 -chmod +x manifest-tool - -# Apply to latest -./manifest-tool push from-spec multi-arch-manifest.yaml \ No newline at end of file diff --git a/hooks/pre_build b/hooks/pre_build deleted file mode 100755 index 1e3f50f..0000000 --- a/hooks/pre_build +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -BUILD_ARCH=$(echo "${DOCKERFILE_PATH}" | cut -d '.' -f 2) - -[ "${BUILD_ARCH}" == "Dockerfile" ] && \ - { echo 'qemu-user-static: Registration not required for current arch'; exit 0; } - -docker run --rm --privileged multiarch/qemu-user-static:register --reset \ No newline at end of file