From eebeac99a0766d1a0a9829d7f3c44d3730795bf9 Mon Sep 17 00:00:00 2001 From: Joe Testa Date: Wed, 20 Dec 2023 15:40:01 -0500 Subject: [PATCH] Updated packaging instructions and Docker build steps. --- Makefile.docker | 15 +++++++++++++-- PACKAGING.md | 13 ++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Makefile.docker b/Makefile.docker index b753f5b..1b2b51c 100644 --- a/Makefile.docker +++ b/Makefile.docker @@ -4,10 +4,21 @@ ifeq ($(VERSION),) endif all: - docker build -t positronsecurity/ssh-audit:${VERSION} . + docker buildx create --name multiarch --use || exit 0 + docker buildx build \ + --platform linux/amd64,linux/arm64,linux/arm/v7 \ + --tag positronsecurity/ssh-audit:${VERSION} \ + --tag positronsecurity/ssh-audit:latest \ + . + docker buildx build \ + --tag positronsecurity/ssh-audit:${VERSION} \ + --tag positronsecurity/ssh-audit:latest \ + --load \ + --builder=multiarch \ + . upload: - docker login + docker login -u positronsecurity docker buildx build \ --platform linux/amd64,linux/arm64,linux/arm/v7 \ --tag positronsecurity/ssh-audit:${VERSION} \ diff --git a/PACKAGING.md b/PACKAGING.md index a821425..8f1bc4f 100644 --- a/PACKAGING.md +++ b/PACKAGING.md @@ -2,7 +2,7 @@ An executable can only be made on a Windows host because the PyInstaller tool (https://www.pyinstaller.org/) does not support cross-compilation. -1.) Install Python v3.11.x from https://www.python.org/. To make life easier, check the option to add Python to the PATH environment variable. +1.) Install Python v3.x from https://www.python.org/. To make life easier, check the option to add Python to the PATH environment variable. 2.) Install Cygwin (https://www.cygwin.com/). @@ -15,7 +15,7 @@ An executable can only be made on a Windows host because the PyInstaller tool (h # PyPI -To create package and upload to test server: +To create package and upload to test server (hint: use username '\_\_token\_\_' and API token for test.pypi.org): ``` $ sudo apt install python3-virtualenv python3.10-venv @@ -31,7 +31,7 @@ To download from test server and verify: $ pip3 install --index-url https://test.pypi.org/simple ssh-audit ``` -To upload to production server (hint: use username '\_\_token\_\_' and API token): +To upload to production server (hint: use username '\_\_token\_\_' and API token for production pypi.org): ``` $ make -f Makefile.pypi uploadprod @@ -61,19 +61,22 @@ Upload the snap with: $ snapcraft export-login ~/snap_creds.txt $ export SNAPCRAFT_STORE_CREDENTIALS=$(cat ~/snap_creds.txt) $ snapcraft upload --release=beta ssh-audit_*.snap - $ snapcraft upload --release=stable ssh-audit_*.snap + $ snapcraft status ssh-audit # Note the revision number of the beta channel. + $ snapcraft release ssh-audit X stable # Fill in with the revision number. ``` # Docker +Ensure that the buildx plugin is available by following the installation instructions available at: https://docs.docker.com/engine/install/ubuntu/ + Build a local image with: ``` $ make -f Makefile.docker ``` -Create a multi-architecture build and upload it to Dockerhub with: +Create a multi-architecture build and upload it to Dockerhub with (hint: use the API token as the password): ``` $ make -f Makefile.docker upload