add make target for dev docker image

This commit is contained in:
Willy Kloucek
2021-11-16 10:09:21 +01:00
parent 74e7344221
commit 418b649647
3 changed files with 32 additions and 10 deletions

View File

@@ -7,24 +7,30 @@ release: release-dirs release-linux release-windows release-darwin release-copy
.PHONY: release-dirs
release-dirs:
mkdir -p $(DIST)/binaries $(DIST)/release
.PHONY: release-linux
release-linux: $(GOX) release-dirs
$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
@mkdir -p $(DIST)/binaries $(DIST)/release
# docker specific packaging flags
DOCKER_LDFLAGS += -X "$(OCIS_REPO)/ocis-pkg/config/defaults.BaseDataPathType=path" -X "$(OCIS_REPO)/ocis-pkg/config/defaults.BaseDataPathValue=/var/lib/ocis"
release-linux-docker: $(GOX) release-dirs
$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
release-linux-docker-amd64: $(GOX) release-dirs
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
release-linux-docker-arm: $(GOX) release-dirs
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'arm' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
release-linux-docker-arm64: $(GOX) release-dirs
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'arm64' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-linux
release-linux: $(GOX) release-dirs
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-windows
release-windows: $(GOX) release-dirs
$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-darwin
release-darwin: $(GOX) release-dirs
$(GOX) -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64 arm64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-copy
release-copy:

View File

@@ -1,3 +1,13 @@
# Please consider to not use this Dockerfile.
# If you want to build an image from source,
# you might want to run following command instead:
# `make -C ocis dev-docker`
# It will build a `owncloud/ocis:dev` image for you.
# If you still want to build oCIS using this Dockerfile
# you can do it by running following command:
# `docker build -t owncloud/ocis:custom .`
FROM owncloudci/nodejs:14 as generate
COPY ./ /ocis/
@@ -12,7 +22,6 @@ COPY --from=generate /ocis /ocis
WORKDIR /ocis/ocis
RUN make ci-go-generate build
FROM alpine:3.13
RUN apk update && \

View File

@@ -6,6 +6,7 @@ include ../.make/recursion.mk
############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
GOARCH := $(shell go env GOARCH)
endif
############ go tooling ############
@@ -25,6 +26,12 @@ config-docs-generate: $(FLAEX)
@echo "$(NAME): generating config docs"
@$(FLAEX) >| ../docs/$(NAME)/configuration.md
############ dev-docker ############
.PHONY: dev-docker
dev-docker:
$(MAKE) --no-print-directory release-linux-docker-$(GOARCH)
docker build -f docker/Dockerfile.linux.$(GOARCH) -t owncloud/ocis:dev .
############ generate ############
include ../.make/generate.mk