combine image build steps

This commit is contained in:
Bradley Cicenas 2017-07-12 03:05:08 +00:00
parent b88c143914
commit 40fd9e935a
3 changed files with 14 additions and 16 deletions

View File

@ -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"]

View File

@ -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/

View File

@ -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: