From 36e84da7b5e8a242df1e46e5c7e5fdbf20384728 Mon Sep 17 00:00:00 2001 From: Mathias Kaufmann Date: Tue, 13 Mar 2018 23:52:03 +0100 Subject: [PATCH] Added Dockerfile Signed-off-by: Mathias Kaufmann --- .dockerignore | 7 +++++++ Dockerfile | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..4549da4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +**/* +!.git/ +!*.go +!GNUmakefile +!common.mk +!Dockerfile +!.dockerignore \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1bb5e5b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:1.10 AS goircd-builder +ARG PACKAGE=github.com/bbusse/goircd +ENV PACKAGE=$PACKAGE + +WORKDIR /go/src/github.com/bbusse/goircd/ + +ADD . /go/src/github.com/bbusse/goircd/ + +RUN export CGO_ENABLED=0 \ + && go get $PACKAGE \ + && make -f GNUmakefile goircd \ + && mv goircd /go/bin/goircd + +FROM alpine AS goircd +COPY --from=goircd-builder /go/bin/goircd /bin/goircd +ENTRYPOINT ["sh","-c"] +CMD ["exec goircd"] \ No newline at end of file