merge changes from CRW version of dockerfile so we're a bit more consistent - CRW-87

Change-Id: Ie8f5bfefdbe47ff80d04dfb98d30382b074a0e22
Signed-off-by: nickboldt <nboldt@redhat.com>
6.18.x
nickboldt 2019-02-08 11:35:34 -05:00
parent 047cbc2f4c
commit 606d5d6622
1 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,4 @@
#
# Copyright (c) 2012-2018 Red Hat, Inc.
# Copyright (c) 2018-2019 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
@ -8,13 +7,14 @@
#
# Contributors:
# Red Hat, Inc. - initial API and implementation
#
FROM golang:1.10.3 as builder
USER root
ADD . /go/src/github.com/eclipse/che-operator
RUN cd /go/src/github.com/eclipse/che-operator && go test -v ./...
RUN OOS=linux GOARCH=amd64 CGO_ENABLED=0 \
go build -o /tmp/che-operator/che-operator \
/go/src/github.com/eclipse/che-operator/cmd/che-operator/main.go
RUN cd /go/src/github.com/eclipse/che-operator && go test -v ./... && \
OOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /tmp/che-operator/che-operator \
/go/src/github.com/eclipse/che-operator/cmd/che-operator/main.go && cd ..
FROM alpine:3.7
COPY --from=builder /tmp/che-operator/che-operator /usr/local/bin/che-operator