Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM npiai/base:3.10
FROM --platform=$BUILDPLATFORM npiai/base:3.10

LABEL maintainer="Wenfeng Wang <[email protected]>"

Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LD_FLAGS += -X 'main.BuildDate=${DATE}'
LD_FLAGS += -X 'main.Platform=${GOOS}/${GOARCH}'

GO_BUILD = GOOS=$(GOOS) GOARCH=$(GOARCH) go build -C ${NPI_CMD_ROOT}/cli -trimpath
DOCKER_PLATFORM ?= linux/arm/v8,linux/amd64
DOCKER_PLATFORM ?= linux/arm64,linux/amd64

build-npi:
$(GO_BUILD) -ldflags "${LD_FLAGS}" -o ${CMD_OUTPUT_DIR}/npi ${NPI_CMD_ROOT}/cli
Expand All @@ -28,11 +28,10 @@ release-npi-cli:
zip -j ${CMD_OUTPUT_DIR}/npi-${VERSION}-${GOOS}-${GOARCH}.zip ${CMD_OUTPUT_DIR}/npi

docker-build:
docker buildx build --platform linux/amd64 -t npiai/npi:${IMAGE_TAG} . --push
docker buildx build --platform ${DOCKER_PLATFORM} -t npiai/npi:${IMAGE_TAG} . --push

docker-build-base:
docker build --platform linux/amd64 -t npiai/base:3.10 -f build/base.Dockerfile build --push
docker push npiai/base:3.10
docker buildx build --platform ${DOCKER_PLATFORM} -t npiai/base:3.10 -f build/base.Dockerfile build --push

docker-build-local:
docker build -t npiai/npi:${IMAGE_TAG} .
Expand Down
2 changes: 1 addition & 1 deletion build/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10
FROM --platform=$BUILDPLATFORM python:3.10

LABEL maintainer="Wenfeng Wang <[email protected]>"

Expand Down