From 885c68fdc6a7b7255dc6d6ea6858d6a4ce914925 Mon Sep 17 00:00:00 2001 From: Mark Bonicillo Date: Tue, 11 Jun 2024 14:34:56 -0700 Subject: [PATCH] Build multi-architecture Docker images to support Apple Silicon and Intel machines --- .github/workflows/publish-to-dockerhub.yml | 1 + README.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-dockerhub.yml b/.github/workflows/publish-to-dockerhub.yml index 7f0b412e..3ae520bd 100644 --- a/.github/workflows/publish-to-dockerhub.yml +++ b/.github/workflows/publish-to-dockerhub.yml @@ -57,5 +57,6 @@ jobs: id: push uses: docker/build-push-action@v5 with: + platforms: linux/amd64,linux/arm64 tags: hypernetx/hypernetx:latest push: true diff --git a/README.md b/README.md index 17fd9706..231b6ce6 100644 --- a/README.md +++ b/README.md @@ -442,7 +442,8 @@ you change a document file, it will automatically render on your browser, allowi If you want to test the Docker image after making any source code changes, follow this workflow: 1. Make a change in the HNX codebase -2. Build image: `docker build --rm --tag hypernetx/hypernetx:latest` +2. Build image for multi-platforms (i.e.ARM64, x86): `docker build --platform linux/amd64,linux/arm64 --rm --tag hypernetx/hypernetx:latest .` + 3. If you're having issues building, see https://docs.docker.com/desktop/containerd/ 3. Test image: `docker run -it --rm -p 8888:8888 -v "${PWD}":/home/jovyan/work hypernetx/hypernetx:latest` 4. Open a browser to [http://localhost:8888/tree](http://localhost:8888/tree). Check that tutorials still work and/or open a notebook and test the changes that you made. 5. Once finished testing, kill the container using Ctrl-C