From 5863c20d91d8668b976560360a5d175fa7f2e619 Mon Sep 17 00:00:00 2001 From: Christos Hadjiaslanis Date: Mon, 17 Jun 2024 15:42:24 +0200 Subject: [PATCH 1/2] Docker compose works for MacOS --- docker/compose.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docker/compose.sh b/docker/compose.sh index e0d9371807e..bcdcf885c0b 100755 --- a/docker/compose.sh +++ b/docker/compose.sh @@ -28,7 +28,21 @@ cleanup() { trap cleanup EXIT INT cd "$ROOT_DIR" -docker build -f docker/Dockerfile . -t linera-test + +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + docker build -f docker/Dockerfile . -t linera-test +elif [[ "$OSTYPE" == "darwin"* ]]; then + CPU_ARCH=$(sysctl -n machdep.cpu.brand_string) + if [[ "$CPU_ARCH" == *"Apple"* ]]; then + docker build --build-arg target=aarch64-unknown-linux-gnu -f docker/Dockerfile -t linera-test . + else + echo "Unsupported Architecture: $CPU_ARCH" + exit 1; + fi +else + echo "Unsupported OS: $OSTYPE" + exit 1; +fi cd "$SCRIPT_DIR" From 83e27e8a659cf445ae94682da519714e1f77e4ce Mon Sep 17 00:00:00 2001 From: Christos Hadjiaslanis Date: Mon, 17 Jun 2024 16:04:36 +0200 Subject: [PATCH 2/2] Added compose.sh to paths which will trigger the docker CI workflow --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7fbe7f4c2b2..c1b27ab3d82 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -8,6 +8,7 @@ on: - "**" paths: - 'docker/Dockerfile' + - 'docker/compose.sh' - 'Cargo.toml' - '.github/workflows/docker.yml' workflow_dispatch: