Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Weiss committed Dec 19, 2018
1 parent 1f52eff commit b863c7d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# oscalkit - OSCAL conversion utility
# Written in 2017 by Andrew Weiss <andrew.weiss@docker.com>

# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain worldwide.
# This software is distributed without any warranty.

# You should have received a copy of the CC0 Public Domain Dedication along with this software.
# If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.

FROM golang:1.11 AS race-detector
WORKDIR /go/src/github.com/opencontrol/oscalkit
COPY . .
WORKDIR /go/src/github.com/opencontrol/oscalkit/cli
RUN go build -race

FROM golang:1.11
ARG GOOS
ARG GOARCH
ARG VERSION
ARG BUILD
ARG DATE
ARG BINARY
WORKDIR /go/src/github.com/opencontrol/oscalkit
COPY --from=race-detector /go/src/github.com/opencontrol/oscalkit .
WORKDIR /go/src/github.com/opencontrol/oscalkit/cli
RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /${BINARY} -v -ldflags "-s -w -X github.com/opencontrol/oscalkit/cli/version.Version=${VERSION} -X github.com/opencontrol/oscalkit/cli/version.Build=${BUILD} -X github.com/opencontrol/oscalkit/cli/version.Date=${DATE}"

0 comments on commit b863c7d

Please sign in to comment.