airshipctl/Dockerfile
Ian Howell dc9c78b210 Fix the coverage tests
This fixes a bug where `make cover` was missing packages. The target now
covers all code except for code placed in the top level package (such as
main.go) and anything placed in the testutils directory.

This also fixes minor issues with the Dockerfile and the coverage_check
script

Note that this commit also strives to increase code coverage beyond the
80% margin

Change-Id: I9e1cbcf841cc869345a00f05e39774cb3da10065
2019-10-02 15:18:56 -05:00

19 lines
441 B
Docker

ARG GO_IMAGE=docker.io/golang:1.12.6-stretch
ARG RELEASE_IMAGE=scratch
FROM ${GO_IMAGE} as builder
SHELL [ "/bin/bash", "-cex" ]
ADD . /usr/src/airshipctl
WORKDIR /usr/src/airshipctl
ENV GO111MODULE=on
RUN make get-modules
ARG MAKE_TARGET=build
RUN make ${MAKE_TARGET}
FROM ${RELEASE_IMAGE} as release
COPY --from=builder /usr/src/airshipctl/bin/airshipctl /usr/local/bin/airshipctl
USER 65534
ENTRYPOINT [ "/usr/local/bin/airshipctl" ]