Skip to content

Commit 7bc5d36

Browse files
SvenDowideitspf13
authored andcommitted
Use a Docker container to build hugo
Signed-off-by: Sven Dowideit <[email protected]>
1 parent bc48b46 commit 7bc5d36

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
FROM golang:1.5
2+
MAINTAINER Sven Dowideit <[email protected]>
3+
4+
ENV GOPATH /go
5+
ENV USER root
6+
7+
# pre-install known dependencies before the source, so we don't redownload them whenever the source changes
8+
RUN go get github.com/stretchr/testify/assert \
9+
&& go get bitbucket.org/pkg/inflect \
10+
&& go get github.com/BurntSushi/toml \
11+
&& go get github.com/PuerkitoBio/purell \
12+
&& go get github.com/opennota/urlesc \
13+
&& go get github.com/dchest/cssmin \
14+
&& go get github.com/eknkc/amber \
15+
&& go get github.com/gorilla/websocket \
16+
&& go get github.com/kardianos/osext \
17+
&& go get github.com/miekg/mmark \
18+
&& go get github.com/mitchellh/mapstructure \
19+
&& go get github.com/russross/blackfriday \
20+
&& go get github.com/shurcooL/sanitized_anchor_name \
21+
&& go get github.com/spf13/afero \
22+
&& go get github.com/spf13/cast \
23+
&& go get github.com/spf13/jwalterweatherman \
24+
&& go get github.com/spf13/cobra \
25+
&& go get github.com/cpuguy83/go-md2man \
26+
&& go get github.com/inconshreveable/mousetrap \
27+
&& go get github.com/spf13/pflag \
28+
&& go get github.com/spf13/fsync \
29+
&& go get github.com/spf13/viper \
30+
&& go get github.com/kr/pretty \
31+
&& go get github.com/kr/text \
32+
&& go get github.com/magiconair/properties \
33+
&& go get golang.org/x/text/transform \
34+
&& go get golang.org/x/text/unicode/norm \
35+
&& go get github.com/yosssi/ace \
36+
&& go get github.com/spf13/nitro \
37+
&& go get gopkg.in/fsnotify.v1
38+
39+
COPY . /go/src/github.com/spf13/hugo
40+
RUN go get -d -v github.com/spf13/hugo
41+
RUN go install github.com/spf13/hugo
42+
43+
WORKDIR /go/src/github.com/spf13/hugo
44+
RUN go get -d -v
45+
RUN go build -o hugo main.go
46+
RUN go test github.com/spf13/hugo/...
47+

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ install-gitinfo:
2525
no-git-info:
2626
go build -o hugo main.go
2727

28+
docker:
29+
docker build -t hugo .
30+
docker rm -f hugo-build || true
31+
docker run --name hugo-build hugo ls /go/bin
32+
docker cp hugo-build:/go/bin/hugo .
33+
docker rm hugo-build

0 commit comments

Comments
 (0)