Added build workflow
rodzic
22ba3620ab
commit
c08efdcc8a
|
@ -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
|
|
@ -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"]
|
|
|
@ -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"]
|
|
|
@ -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"]
|
|
|
@ -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" \
|
|
||||||
.
|
|
|
@ -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
|
|
|
@ -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
|
|
Ładowanie…
Reference in New Issue