Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from emgag/docker
Browse files Browse the repository at this point in the history
Docker
  • Loading branch information
maetthu authored Apr 15, 2019
2 parents acce0e9 + e3cfc1e commit 664c52f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 7 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.idea
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Build image
FROM alpine:latest AS build

# Build requirements
RUN apk add --no-cache ca-certificates

# Copy binary
COPY dist/linux_amd64/keyvault-certdeploy /

# ---

# Runtime image
FROM scratch
LABEL maintainer="Matthias Blaser <[email protected]>"

COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /keyvault-certdeploy /keyvault-certdeploy

CMD ["/keyvault-certdeploy"]
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ OUT := keyvault-certdeploy
PKG := github.com/emgag/keyvault-certdeploy
PKG_LIST := $(shell go list ${PKG}/... )
GO_FILES := $(shell find . -name '*.go' )
VERSION := $(shell git describe --always --dirty --tags)

all: build

Expand Down Expand Up @@ -36,4 +37,10 @@ clean:
-@rm -vf ${OUT}
-@rm -vrf dist


docker:
docker build \
-t emgag/keyvault-certdeploy:${VERSION} \
-t emgag/keyvault-certdeploy:latest\
.
docker push emgag/keyvault-certdeploy:${VERSION}
docker push emgag/keyvault-certdeploy:latest
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

[![Build Status](https://travis-ci.org/emgag/keyvault-certdeploy.svg?branch=master)](https://travis-ci.org/emgag/keyvault-certdeploy)
[![Go Report Card](https://goreportcard.com/badge/github.com/emgag/keyvault-certdeploy)](https://goreportcard.com/report/github.com/emgag/keyvault-certdeploy)
[![Docker Pulls](https://img.shields.io/docker/pulls/emgag/keyvault-certdeploy.svg)](https://hub.docker.com/r/emgag/keyvault-certdeploy)
[![Image Layers](https://images.microbadger.com/badges/image/emgag/keyvault-certdeploy.svg)](https://microbadger.com/images/emgag/keyvault-certdeploy "Get your own image badge on microbadger.com")
[![Latest Version](https://images.microbadger.com/badges/version/emgag/keyvault-certdeploy.svg)](https://microbadger.com/images/emgag/keyvault-certdeploy "Get your own version badge on microbadger.com")


**keyvault-certdeploy** is a helper tool used to facilitate X.509 certificate deployment to Linux VMs with [Azure Key Vault](https://azure.microsoft.com/en-us/services/key-vault/). Unlike the built-in method via VM secrets, it does support RSA and ECDSA certificates, local deployment and update hooks. It can be used to push certificates to Key Vault from a Let's Encrypt deployment hook and to refresh VM certificates on boot or to periodically poll for updates via cronjob.

Expand Down Expand Up @@ -130,18 +134,24 @@ Certificates are pushed to the vault as an unencrypted, single PEM-formated file

## Build

On Linux:
### On Linux

```
$ mkdir keyvault-certdeploy && cd keyvault-certdeploy
$ export GOPATH=$PWD
$ go get -d github.com/emgag/keyvault-certdeploy
$ cd src/github.com/emgag/keyvault-certdeploy
$ make install
$ go get -u github.com/emgag/keyvault-certdeploy
```

will download the source and build binary called _keyvault-certdeploy_ in $GOPATH/bin.

### Using Docker

```
$ go get -u github.com/goreleaser/goreleaser
$ $(go env GOPATH)/bin/goreleaser --snapshot --rm-dist
$ docker build -t keyvault-certdeploy:latest .
```

will build a Docker image.

## License

keyvault-certdeploy is licensed under the [MIT License](http://opensource.org/licenses/MIT).

0 comments on commit 664c52f

Please sign in to comment.