mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
include Makefile instructions for building image from source
This commit is contained in:
12
Dockerfile_build
Normal file
12
Dockerfile_build
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
FROM quay.io/vektorcloud/go:1.8
|
||||||
|
|
||||||
|
RUN apk add --no-cache make
|
||||||
|
|
||||||
|
COPY glide.* /go/src/github.com/bcicen/ctop/
|
||||||
|
WORKDIR /go/src/github.com/bcicen/ctop/
|
||||||
|
RUN glide install
|
||||||
|
|
||||||
|
COPY . /go/src/github.com/bcicen/ctop
|
||||||
|
RUN make build && \
|
||||||
|
mkdir -p /go/bin && \
|
||||||
|
mv -v ctop /go/bin/
|
||||||
8
Makefile
8
Makefile
@@ -10,12 +10,20 @@ build:
|
|||||||
glide install
|
glide install
|
||||||
CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o ctop
|
CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o ctop
|
||||||
|
|
||||||
|
build-dev:
|
||||||
|
go build -ldflags "-w -X main.version=$(VERSION)-dev -X main.build=$(BUILD)"
|
||||||
|
|
||||||
build-all:
|
build-all:
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
GOOS=darwin GOARCH=amd64 go build -tags release -ldflags $(LD_FLAGS) -o build/ctop-$(VERSION)-darwin-amd64
|
GOOS=darwin GOARCH=amd64 go build -tags release -ldflags $(LD_FLAGS) -o build/ctop-$(VERSION)-darwin-amd64
|
||||||
GOOS=linux GOARCH=amd64 go build -tags release -ldflags $(LD_FLAGS) -o build/ctop-$(VERSION)-linux-amd64
|
GOOS=linux GOARCH=amd64 go build -tags release -ldflags $(LD_FLAGS) -o build/ctop-$(VERSION)-linux-amd64
|
||||||
GOOS=linux GOARCH=arm go build -tags release -ldflags $(LD_FLAGS) -o build/ctop-$(VERSION)-linux-arm
|
GOOS=linux GOARCH=arm go build -tags release -ldflags $(LD_FLAGS) -o build/ctop-$(VERSION)-linux-arm
|
||||||
|
|
||||||
|
image:
|
||||||
|
docker build -t ctop_build -f Dockerfile_build .
|
||||||
|
docker run -ti --rm -v $(shell pwd):/target ctop_build cp -v /go/bin/ctop /target/
|
||||||
|
docker build -t ctop -f Dockerfile_minimal .
|
||||||
|
|
||||||
release:
|
release:
|
||||||
mkdir release
|
mkdir release
|
||||||
go get github.com/progrium/gh-release/...
|
go get github.com/progrium/gh-release/...
|
||||||
|
|||||||
Reference in New Issue
Block a user