Skip to content

Commit

Permalink
Merge pull request #572 from arno01/multi-stage
Browse files Browse the repository at this point in the history
use multi-stage build
  • Loading branch information
jzelinskie authored Jul 14, 2018
2 parents 158bb31 + 921ba54 commit 9a9b1f7
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.10-alpine

VOLUME /config
EXPOSE 6060 6061

FROM golang:1.10-alpine AS build
ADD . /go/src/github.com/coreos/clair/
WORKDIR /go/src/github.com/coreos/clair/
RUN go build github.com/coreos/clair/cmd/clair

RUN apk add --no-cache git rpm xz dumb-init && \
go install -v github.com/coreos/clair/cmd/clair && \
mv /go/bin/clair /clair && \
rm -rf /go /usr/local/go

FROM alpine:3.8
COPY --from=build /go/src/github.com/coreos/clair/clair /clair
RUN apk add --no-cache git rpm xz ca-certificates dumb-init
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/clair"]

VOLUME /config
EXPOSE 6060 6061

0 comments on commit 9a9b1f7

Please sign in to comment.