This repository has been archived by the owner on Feb 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PKI provider Docker plugin configuration and build configuration
- Loading branch information
1 parent
e1e8661
commit 9eeb15d
Showing
4 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
example/ | ||
config.json | ||
Dockerfile | ||
README.md | ||
tusk.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM golang:1.12-alpine AS builder | ||
|
||
ENV GO111MODULE=on | ||
|
||
RUN apk add --no-cache git gcc libc-dev | ||
|
||
COPY . /go/src/github.com/sendsmaily/docker-secretprovider-pki | ||
|
||
WORKDIR /go/src/github.com/sendsmaily/docker-secretprovider-pki | ||
|
||
RUN set -ex && go install --ldflags '-extldflags "-static"' | ||
|
||
|
||
FROM alpine:latest | ||
|
||
RUN apk add --no-cache ca-certificates | ||
|
||
COPY --from=builder /go/bin/docker-secretprovider-pki . | ||
|
||
CMD ["docker-secretprovider-pki"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"description": "PKI secrets plugin", | ||
"documentation": "https://github.com/sendsmaily", | ||
"env": [ | ||
{ | ||
"name": "BACKEND", | ||
"description": "PKI provider backend to use", | ||
"settable": [ | ||
"value" | ||
], | ||
"value": "test" | ||
} | ||
], | ||
"entrypoint": [ | ||
"/docker-secretprovider-pki" | ||
], | ||
"mounts": [ | ||
{ | ||
"destination": "/secrethub", | ||
"source": "/etc/docker/secrethub", | ||
"options": [ | ||
"rbind" | ||
], | ||
"type": "bind" | ||
}, | ||
{ | ||
"destination": "/docker.sock", | ||
"source": "/run/docker.sock", | ||
"options": [ | ||
"rbind" | ||
], | ||
"type": "bind" | ||
} | ||
], | ||
"network": { | ||
"type": "host" | ||
}, | ||
"interface": { | ||
"types": [ | ||
"docker.secretprovider/1.0" | ||
], | ||
"socket": "plugin.sock" | ||
}, | ||
"linux": { | ||
"capabilities": [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
tasks: | ||
set-environment: | ||
private: true | ||
options: | ||
build-tag: | ||
default: | ||
command: git log -1 --pretty=%h ./ | ||
run: | ||
- set-environment: | ||
BUILD_TAG: ${build-tag} | ||
|
||
build.plugin: | ||
usage: Build the PKI plugin | ||
run: | ||
- task: set-environment | ||
# Clean up. | ||
- command: rm -rf ./plugin | ||
# Build the plugin, then extract the created filesystem from the image | ||
# into `./plugin/rootfs` directory. | ||
- command: docker build -t sendsmaily/docker-secretprovider-pki:rootfs . | ||
- command: mkdir -p ./plugin/rootfs | ||
- command: docker create --name sendsmaily-pki-rootfs sendsmaily/docker-secretprovider-pki:rootfs | ||
- command: docker export sendsmaily-pki-rootfs | tar -xC ./plugin/rootfs | ||
- command: docker rm -vf sendsmaily-pki-rootfs | ||
# Copy over configuration file needed to run the plugin. | ||
- command: cp config.json ./plugin/ | ||
# Then create the plugin from created file system. | ||
- command: docker plugin rm -f sendsmaily/docker-secretprovider-pki:${BUILD_TAG} || true | ||
- command: docker plugin create sendsmaily/docker-secretprovider-pki:${BUILD_TAG} ./plugin | ||
|
||
publish.plugin: | ||
usage: Publish the PKI plugin on Docker Hub | ||
run: | ||
- task: set-environment | ||
- command: docker plugin push sendsmaily/docker-secretprovider-pki:${BUILD_TAG} | ||
- command: docker plugin push sendsmaily/docker-secretprovider-pki:latest |