aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSven Dowideit <[email protected]>2016-01-04 17:27:21 +1000
committerSteve Francia <[email protected]>2016-01-04 12:47:23 -0500
commit7bc5d3663fc0fdb87bb21235fe3b3cc534129ce1 (patch)
treeae11620a906b053767eb8806ed9a5995175a388e
parentbc48b4606ab436a17f663249482c41704d8b57c0 (diff)
downloadhugo-7bc5d3663fc0fdb87bb21235fe3b3cc534129ce1.tar.gz
hugo-7bc5d3663fc0fdb87bb21235fe3b3cc534129ce1.zip
Use a Docker container to build hugo
Signed-off-by: Sven Dowideit <[email protected]>
-rw-r--r--Dockerfile47
-rw-r--r--Makefile6
2 files changed, 53 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000..db643e2b7
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,47 @@
+FROM golang:1.5
+MAINTAINER Sven Dowideit <[email protected]>
+
+ENV GOPATH /go
+ENV USER root
+
+# pre-install known dependencies before the source, so we don't redownload them whenever the source changes
+RUN go get github.com/stretchr/testify/assert \
+ && go get bitbucket.org/pkg/inflect \
+ && go get github.com/BurntSushi/toml \
+ && go get github.com/PuerkitoBio/purell \
+ && go get github.com/opennota/urlesc \
+ && go get github.com/dchest/cssmin \
+ && go get github.com/eknkc/amber \
+ && go get github.com/gorilla/websocket \
+ && go get github.com/kardianos/osext \
+ && go get github.com/miekg/mmark \
+ && go get github.com/mitchellh/mapstructure \
+ && go get github.com/russross/blackfriday \
+ && go get github.com/shurcooL/sanitized_anchor_name \
+ && go get github.com/spf13/afero \
+ && go get github.com/spf13/cast \
+ && go get github.com/spf13/jwalterweatherman \
+ && go get github.com/spf13/cobra \
+ && go get github.com/cpuguy83/go-md2man \
+ && go get github.com/inconshreveable/mousetrap \
+ && go get github.com/spf13/pflag \
+ && go get github.com/spf13/fsync \
+ && go get github.com/spf13/viper \
+ && go get github.com/kr/pretty \
+ && go get github.com/kr/text \
+ && go get github.com/magiconair/properties \
+ && go get golang.org/x/text/transform \
+ && go get golang.org/x/text/unicode/norm \
+ && go get github.com/yosssi/ace \
+ && go get github.com/spf13/nitro \
+ && go get gopkg.in/fsnotify.v1
+
+COPY . /go/src/github.com/spf13/hugo
+RUN go get -d -v github.com/spf13/hugo
+RUN go install github.com/spf13/hugo
+
+WORKDIR /go/src/github.com/spf13/hugo
+RUN go get -d -v
+RUN go build -o hugo main.go
+RUN go test github.com/spf13/hugo/...
+
diff --git a/Makefile b/Makefile
index 823428fb9..46e75fce7 100644
--- a/Makefile
+++ b/Makefile
@@ -25,3 +25,9 @@ install-gitinfo:
no-git-info:
go build -o hugo main.go
+docker:
+ docker build -t hugo .
+ docker rm -f hugo-build || true
+ docker run --name hugo-build hugo ls /go/bin
+ docker cp hugo-build:/go/bin/hugo .
+ docker rm hugo-build