From 40fd9e935a23369c536afaa5e1c19442ea7c807b Mon Sep 17 00:00:00 2001 From: Bradley Cicenas Date: Wed, 12 Jul 2017 03:05:08 +0000 Subject: [PATCH] combine image build steps --- Dockerfile | 15 ++++++++++++++- Dockerfile_build | 12 ------------ Makefile | 3 --- 3 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 Dockerfile_build diff --git a/Dockerfile b/Dockerfile index f9cfbbc..c1aa64f 100644 --- a/Dockerfile +++ b/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 -COPY ./ctop /ctop +COPY --from=0 /go/bin/ctop /ctop ENTRYPOINT ["/ctop"] diff --git a/Dockerfile_build b/Dockerfile_build deleted file mode 100644 index aa57a1f..0000000 --- a/Dockerfile_build +++ /dev/null @@ -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/ diff --git a/Makefile b/Makefile index 69717ce..fbf8dba 100644 --- a/Makefile +++ b/Makefile @@ -22,9 +22,6 @@ build-all: GOOS=linux GOARCH=arm64 go build -tags release -ldflags $(LD_FLAGS) -o _build/ctop-$(VERSION)-linux-arm64 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 . release: