File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1313 - name : Checkout source code
1414 uses : actions/checkout@v1
1515
16+ - name : Set docker build as alias to buildx (multiarch build)
17+ uses : docker/setup-buildx-action@v1
18+ id : buildx
19+ with :
20+ install : true
1621
1722 - name : Deploy to Docker Hub
1823 if : success() && startsWith(github.ref, 'refs/tags/v')
@@ -22,13 +27,16 @@ jobs:
2227 DOCKER_IMAGE : grafolean/grafolean-snmp-bot
2328 DOCKER_USER : grafolean
2429 DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
30+ BUILD_PLATFORMS : linux/amd64,linux/arm/v7
2531 run : |
32+ echo "Available plaftorms: ${{ steps.buildx.outputs.platforms }}"
33+ echo "Building for plaftorms: $BUILD_PLATFORMS"
2634 export VERSION=${GITHUB_REF_TAG:10:50}
2735 echo "Version is $VERSION"
2836 export LAST_KNOWN_VERSION=`git tag -l --sort=-version:refname "v*.*.*" | grep -v rc | head -n 1 | tr -d '[:space:]'`
2937 echo "Last known version is $LAST_KNOWN_VERSION"
3038 docker login -u $DOCKER_USER -p $DOCKER_PASSWORD $DOCKER_REGISTRY
31- docker build -t "docker.io/$DOCKER_IMAGE:$VERSION" -t "docker.io/$DOCKER_IMAGE:latest" --build-arg VERSION=$VERSION --build-arg VCS_REF=$GITHUB_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') .
39+ docker build --platform "$BUILD_PLATFORMS" - t "docker.io/$DOCKER_IMAGE:$VERSION" -t "docker.io/$DOCKER_IMAGE:latest" --build-arg VERSION=$VERSION --build-arg VCS_REF=$GITHUB_SHA --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') .
3240 [ "$LAST_KNOWN_VERSION" == "$VERSION" ] && docker tag "docker.io/$DOCKER_IMAGE:$VERSION" "docker.io/$DOCKER_IMAGE:latest" || echo "NOT MARKING AS LATEST!"
3341 docker images
3442 docker push "docker.io/$DOCKER_IMAGE:$VERSION"
Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ LABEL org.label-schema.vendor="Grafolean" \
3131COPY --from=python-requirements /requirements.txt /requirements.txt
3232RUN \
3333 apt-get update && \
34- apt-get install --no-install-recommends -q -y libsnmp-dev build-essential git && \
34+ apt-get install --no-install-recommends -q -y libsnmp-dev build-essential libpq-dev python3-dev git && \
3535 pip install --no-cache-dir -r /requirements.txt && \
36- apt-get purge -y build-essential && \
36+ apt-get purge -y build-essential libpq-dev python3-dev && \
3737 apt-get clean autoclean && \
3838 apt-get autoremove --yes && \
3939 rm -rf /var/lib/{apt,dpkg,cache,log}/ && \
You can’t perform that action at this time.
0 commit comments