Skip to content

Commit

Permalink
working to get the build working on an M1 mac
Browse files Browse the repository at this point in the history
  • Loading branch information
briandoconnor committed Jul 12, 2023
1 parent e394f7f commit fe2aa54
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jar-run:
# build docker image
.PHONY: docker-build
docker-build: jar-build
docker build -t ${DOCKER_IMG} --build-arg VERSION=${DOCKER_TAG} .
docker build --platform linux/amd64 -t ${DOCKER_IMG} --build-arg VERSION=${DOCKER_TAG} .

# push image to docker hub
.PHONY: docker-publish
Expand Down
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,36 @@ docker pull --platform linux/amd64 adoptopenjdk/openjdk12:jre-12.0.2_10-alpine
Build the image:
Doesn't seem to work on Mac M1
```
# debian VM on google cloud
# install docker
https://docs.docker.com/engine/install/debian/
# setup dev environment
sudo apt install default-jdk gradle sqlite3 make
# build docker with make
make docker-build
# and this worked!
# build the docker manually (don't do this, use Make)
docker build -f Dockerfile -t ga4gh/ga4gh-starter-kit-drs:latest --build-arg VERSION=0.3.3 .
# M1 Mac (doesn't build)
softwareupdate --install-rosetta
brew install openjdk@17
echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
brew install sqlite3 make gradle
make docker-build
# I updated build.gradle version number
version '0.3.3'
# I had to update the makefile to include --platform:
docker-build: jar-build
docker build --platform linux/amd64 -t ${DOCKER_IMG} --build-arg VERSION=${DOCKER_TAG} .
docker build --platform linux/amd64 -f Dockerfile -t ga4gh/ga4gh-starter-kit-drs:latest .
```

Pull the image:
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ configurations.all {

archivesBaseName = 'ga4gh-starter-kit-drs'
group 'org.ga4gh'
version '0.3.2'
version '0.3.3'

repositories {
// Use jcenter for resolving dependencies.
Expand Down Expand Up @@ -102,4 +102,4 @@ jacocoTestReport {
xml.enabled = true
html.enabled = true
}
}
}

0 comments on commit fe2aa54

Please sign in to comment.