Skip to content

Commit

Permalink
use image from docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerKSI committed Oct 28, 2023
1 parent 44811fc commit dd56c60
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,51 +1,47 @@
.PHONY: docker-images docker-image-linux docker-image-osx

DOCKER_IMAGE := owasm/go-ext-builder
DOCKER_IMAGE := kitipong/go-owasm-ext-builder
DOCKER_TAG := 0.0.1
PROJECT := band-playground
USER_ID := $(shell id -u)
USER_GROUP := $(shell id -g)

docker-image-alpine:
docker build . -t $(DOCKER_IMAGE)$(DOCKER_TAG)-alpine -f build/Dockerfile.alpine
docker tag $(DOCKER_IMAGE):$(DOCKER_TAG)-alpine gcr.io/$(PROJECT)/$(DOCKER_IMAGE):$(DOCKER_TAG)-alpine
docker build . -t $(DOCKER_IMAGE):$(DOCKER_TAG)-alpine -f build/Dockerfile.alpine

docker-image-linux:
docker build . -t $(DOCKER_IMAGE):$(DOCKER_TAG)-linux -f build/Dockerfile.linux
docker tag $(DOCKER_IMAGE):$(DOCKER_TAG)-linux gcr.io/$(PROJECT)/$(DOCKER_IMAGE):$(DOCKER_TAG)-linux

docker-image-osx:
docker build . -t $(DOCKER_IMAGE):$(DOCKER_TAG)-osx -f build/Dockerfile.osx
docker tag $(DOCKER_IMAGE):$(DOCKER_TAG)-osx gcr.io/$(PROJECT)/$(DOCKER_IMAGE):$(DOCKER_TAG)-osx

docker-images:
make docker-image-osx
make docker-image-linux
make docker-image-alpine

docker-publish:
docker push gcr.io/$(PROJECT)/$(DOCKER_IMAGE):$(DOCKER_TAG)-alpine
docker push gcr.io/$(PROJECT)/$(DOCKER_IMAGE):$(DOCKER_TAG)-linux
docker push gcr.io/$(PROJECT)/$(DOCKER_IMAGE):$(DOCKER_TAG)-osx
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)-alpine
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)-linux
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)-osx

# Creates a release build in a containerized build environment of the static library for Alpine Linux (.a)
release-alpine:
rm -rf libgo_owasm/target/release
rm -rf libgo_owasm/target/x86_64-unknown-linux-musl/release
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code/go-owasm gcr.io/$(PROJECT)/$(DOCKER_IMAGE):$(DOCKER_TAG)-alpine build_alpine.sh
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code/go-owasm $(DOCKER_IMAGE):$(DOCKER_TAG)-alpine build_alpine.sh

# Creates a release build in a containerized build environment of the shared library for glibc Linux (.so)
release-linux:
rm -rf libgo_owasm/target/release
rm -rf libgo_owasm/target/x86_64-unknown-linux-gnu/release
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code/go-owasm gcr.io/$(PROJECT)/$(DOCKER_IMAGE):$(DOCKER_TAG)-linux build_linux.sh
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code/go-owasm $(DOCKER_IMAGE):$(DOCKER_TAG)-linux build_linux.sh

# Creates a release build in a containerized build environment of the shared library for macOS (.dylib)
release-osx:
rm -rf libgo_owasm/target/release
rm -rf libgo_owasm/target/x86_64-apple-darwin/release
rm -rf libgo_owasm/target/aarch64-apple-darwin/release
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code/go-owasm gcr.io/$(PROJECT)/$(DOCKER_IMAGE):$(DOCKER_TAG)-osx build_osx.sh
docker run --rm -u $(USER_ID):$(USER_GROUP) -v $(shell pwd):/code/go-owasm $(DOCKER_IMAGE):$(DOCKER_TAG)-osx build_osx.sh

releases:
make release-alpine
Expand Down

0 comments on commit dd56c60

Please sign in to comment.