Skip to content

Instantly share code, notes, and snippets.

@javierguerragiraldez
Created February 27, 2020 17:26
Show Gist options
  • Save javierguerragiraldez/cd10ac2a56357b448161dad1817ad178 to your computer and use it in GitHub Desktop.
Save javierguerragiraldez/cd10ac2a56357b448161dad1817ad178 to your computer and use it in GitHub Desktop.
go plugin compiler, Alpine-based
FROM golang:1.13.4-alpine
LABEL maintainer="Kong Core Team <[email protected]>"
RUN apk update && \
apk upgrade && \
apk add git \
bash \
gcc \
musl-dev \
openssl \
go
RUN go get github.com/Kong/go-pluginserver
VOLUME /plugins
WORKDIR /plugins
RUN (echo '#!/bin/sh' && echo 'cp /go/bin/go-pluginserver /plugins') >> /usr/local/bin/get-server
RUN (echo '#!/bin/sh' && echo 'go build -buildmode=plugin "$@"') >> /usr/local/bin/build
RUN chmod a+x /usr/local/bin/*
# to copy go-pluginserver to current directory:
# docker run -it --rm -v `pwd`:/plugins gokit get-server
#
# to compile a plugin:
# docker run -it --rm -v `pwd`:/plugins gokit build go-log.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment