add a docker build for driftcl & badge in readme

main
Martin Guibert 2020-12-11 17:12:22 +01:00
parent e70f03dd93
commit 5bf0b772ba
4 changed files with 36 additions and 1 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
bin/
Dockerfile
.cache
**/*.golden.json

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM golang:1.15.2 AS builder
ARG OS="linux"
ARG ARCH="amd64"
WORKDIR /go/src/app
COPY go.mod go.sum Makefile ./
RUN make deps
COPY . .
RUN OS_ARCH=${OS}/${ARCH} make release
FROM gcr.io/distroless/base-debian10
ARG OS="linux"
ARG ARCH="amd64"
ENV HOME=/app
WORKDIR /app
COPY --from=builder /go/src/app/bin/driftctl_${OS}_${ARCH} /bin/driftctl
ENTRYPOINT ["/bin/driftctl"]

View File

@ -8,7 +8,12 @@
<img src="https://img.shields.io/github/downloads/cloudskiff/driftctl/total.svg"/> <img src="https://img.shields.io/github/downloads/cloudskiff/driftctl/total.svg"/>
<a href="https://codecov.io/gh/cloudskiff/driftctl"> <a href="https://codecov.io/gh/cloudskiff/driftctl">
<img src="https://codecov.io/gh/cloudskiff/driftctl/branch/main/graph/badge.svg?token=8C5R02G5S7"/> <img src="https://codecov.io/gh/cloudskiff/driftctl/branch/main/graph/badge.svg?token=8C5R02G5S7"/>
</a><br> </a>
<img src="https://img.shields.io/docker/pulls/cloudskiff/driftctl"/>
<img src="https://img.shields.io/microbadger/layers/cloudskiff/driftctl"/>
<img src="https://img.shields.io/docker/image-size/cloudskiff/driftctl"/>
<br>
Measures infrastructure as code coverage, and tracks infrastructure drift.<br> Measures infrastructure as code coverage, and tracks infrastructure drift.<br>
:warning: <strong>This tool is still in beta state and will evolve in the future with potential breaking changes</strong> :warning: :warning: <strong>This tool is still in beta state and will evolve in the future with potential breaking changes</strong> :warning:
</p> </p>

View File

@ -32,6 +32,12 @@ os_archs=(
windows/amd64 windows/amd64
) )
if [ -n "$OS_ARCH" ]; then
os_archs=("$OS_ARCH")
fi
echo "ARCH: $os_archs"
if [ $ENV != "release" ]; then if [ $ENV != "release" ]; then
echo "+ Building env: dev" echo "+ Building env: dev"
# If its dev mode, only build for ourself # If its dev mode, only build for ourself