Add Docker files.

master
Carl Kittelberger 2017-02-20 12:45:58 +01:00
parent 3fd06b3ef2
commit b472c0b574
Signed by: icedream
GPG Key ID: C1D30A06E6490C14
2 changed files with 58 additions and 0 deletions

32
.dockerignore Normal file
View File

@ -0,0 +1,32 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
workreportmgr
*.exe
*.test
###
.dockerignore
.editorconfig
.git*
*.md
Dockerfile

26
Dockerfile Normal file
View File

@ -0,0 +1,26 @@
FROM alpine:edge
ARG GO_ROOT_IMPORT_PATH=git.dekart811.net/icedream/workreportmgr
COPY . "/go/src/${GO_ROOT_IMPORT_PATH}"
RUN \
apk add --no-cache --virtual .build-deps \
go=1.7.4-r1 \
git \
libc-dev \
&&\
git config --global http.followRedirects true &&\
mkdir -p /go &&\
export GOPATH=/go &&\
export PATH="${PATH}:${GOPATH}/bin" &&\
go get -v github.com/jteeuwen/go-bindata/... &&\
export CGO_ENABLED=0 &&\
go get -v -d "${GO_ROOT_IMPORT_PATH}/..." &&\
(cd "${GOPATH}/src/${GO_ROOT_IMPORT_PATH}" &&\
go generate -v ./...) &&\
go build -v -a -installsuffix cgo \
-o /usr/local/bin/workreportmgr "${GO_ROOT_IMPORT_PATH}" &&\
apk del .build-deps &&\
rm -rf "${GOPATH}"
ENTRYPOINT ["workreportmgr"]