mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
combine image build steps
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,3 +1,16 @@
|
|||||||
|
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/
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY ./ctop /ctop
|
COPY --from=0 /go/bin/ctop /ctop
|
||||||
ENTRYPOINT ["/ctop"]
|
ENTRYPOINT ["/ctop"]
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
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/
|
|
||||||
3
Makefile
3
Makefile
@@ -22,9 +22,6 @@ build-all:
|
|||||||
GOOS=linux GOARCH=arm64 go build -tags release -ldflags $(LD_FLAGS) -o _build/ctop-$(VERSION)-linux-arm64
|
GOOS=linux GOARCH=arm64 go build -tags release -ldflags $(LD_FLAGS) -o _build/ctop-$(VERSION)-linux-arm64
|
||||||
|
|
||||||
image:
|
image:
|
||||||
docker build -t ctop_build -f Dockerfile_build .
|
|
||||||
docker create --name=ctop_built ctop_build ctop -v
|
|
||||||
docker cp ctop_built:/go/bin/ctop .
|
|
||||||
docker build -t ctop -f Dockerfile .
|
docker build -t ctop -f Dockerfile .
|
||||||
|
|
||||||
release:
|
release:
|
||||||
|
|||||||
Reference in New Issue
Block a user