Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

[feature request] make dfget building without docker in Makefile #313

Closed
allencloud opened this issue Jan 7, 2019 · 2 comments · Fixed by #316
Closed

[feature request] make dfget building without docker in Makefile #313

allencloud opened this issue Jan 7, 2019 · 2 comments · Fixed by #316
Assignees
Labels
kind/feature kind/feature-request This is a feature request from community for project

Comments

@allencloud
Copy link
Contributor

allencloud commented Jan 7, 2019

Why you need it?

dfget is very pure binary which is built from Golang 1.10.4, so we can easily build dfget binary from the source code. While I see in the Makefile, there are https://github.com/dragonflyoss/Dragonfly/blob/master/Makefile#L49-L65:

build-dfget: build-dirs
	@echo "Begin to build dfget."
	@docker run                                                            \
	    --rm                                                               \
	    -ti                                                                \
	    -u $$(id -u):$$(id -g)                                             \
	    -v $$(pwd)/.go:/go                                                 \
	    -v $$(pwd):/go/src/$(PKG)                                          \
	    -v $$(pwd)/$(BUILD_PATH):/go/bin                                   \
	    -v $$(pwd)/.cache:/.cache                                          \
	    -e GOOS=$(GOOS)                                                    \
	    -e GOARCH=$(GOARCH)                                                \
	    -e CGO_ENABLED=0                                                   \
	    -w /go/src/$(PKG)                                                  \
	    $(BUILD_IMAGE)                                                     \
	    go install -v -pkgdir /go/pkg $(LDFLAGS_DFGET) ./cmd/dfget
.PHONY: build-dfget	

It must depend on docker to build binary, which seems to be bothering for users. Since it used to be able to build on MacOS, while with the target in Makefile, user cannot build dfget on MacOS nor Windows.

So I request to make dfget building without docker in Makefile. @fengzixu WDYT

In addition, in pr dragonflyoss/dragonfly#312, I have made it to gen-docs. But before generating, I must build a binary of dfget first. Then I need the feature.

How it could be?

make dfget building without docker in Makefile

Other related information

none

@pouchrobot pouchrobot added kind/feature kind/feature-request This is a feature request from community for project labels Jan 7, 2019
@fengzixu
Copy link
Collaborator

fengzixu commented Jan 7, 2019

When I refactored the dfget for the Dragonfly because the version of golang in my local environment is different with the circleCI used, I suffered many wired problems: Buiding dfget binary file is successful in the local, but it was processed fail during the CI. The root reason is that I used golang whose version is 1.11 and CI used golang whose version is 1.10.4.

That is an unnecessary problem for developers. Both I and @flyer103 also think that we should clear the inconsistencies between the local and CI. So, we refer to the repo: https://github.com/thockin/go-build-template. Actually, during my work, I used docker to build the binary files, so that I don't need to notice the version of dependencies between the production env and local env.

For your requirement, I think that there are two options

  1. Install the docker in your machine, for holding the consistency between the CI and our local env.
  2. Let me add the new command which can admit the user to build dfget and dfdaemon without the docker.

@allencloud

@fengzixu
Copy link
Collaborator

fengzixu commented Jan 7, 2019

/assign

sungjunyoung pushed a commit to sungjunyoung/Dragonfly that referenced this issue May 8, 2022
* chore: add goreleaser nfpm

Signed-off-by: Gaius <[email protected]>

* chore: change name template

Signed-off-by: Gaius <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature kind/feature-request This is a feature request from community for project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants