Skip to content

Commit

Permalink
Docker compose works for MacOS (#2143)
Browse files Browse the repository at this point in the history
* Docker compose works for MacOS

* Added compose.sh to paths which will trigger the docker CI workflow
  • Loading branch information
christos-h authored Jun 17, 2024
1 parent bf49645 commit a114050
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- "**"
paths:
- 'docker/Dockerfile'
- 'docker/compose.sh'
- 'Cargo.toml'
- '.github/workflows/docker.yml'
workflow_dispatch:
Expand Down
16 changes: 15 additions & 1 deletion docker/compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit a114050

Please sign in to comment.