Skip to content

Commit

Permalink
Updated packaging instructions and Docker build steps.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtesta committed Dec 20, 2023
1 parent dd91c2a commit eebeac9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
15 changes: 13 additions & 2 deletions Makefile.docker
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down
13 changes: 8 additions & 5 deletions PACKAGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eebeac9

Please sign in to comment.