Browse Source

build(feature/extended-builds): upgrade extended build to hugo@0.60.0, go@1.13.4 and alpine@3.10

Josh Habdas 8 months ago
parent
commit
b229f2be22
Signed by: jhabdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74

+ 6
- 6
Dockerfile View File

@@ -17,17 +17,17 @@
17 17
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
18 18
 #
19 19
 
20
-# DOCKER-VERSION 19.03.1-ce, build 74b1e89e8a
20
+# DOCKER-VERSION 19.03.5, build 633a0ea 
21 21
 
22 22
 # Specify build image
23
-ARG GO_VERSION=1.11.4
24
-ARG BUILD_TARGET=alpine3.8
23
+ARG GO_VERSION=1.13.4
24
+ARG BUILD_TARGET=alpine3.10
25 25
 
26 26
 # Pull builder base image
27 27
 FROM golang:${GO_VERSION}-${BUILD_TARGET} AS hugobuilder
28 28
 
29 29
 # Set hugo environment variables
30
-ENV HUGO_VERSION=0.57.0 \
30
+ENV HUGO_VERSION=0.60.0 \
31 31
     CGO_ENABLED=1 \
32 32
     GOOS=linux \
33 33
     GO111MODULE=on \
@@ -35,7 +35,7 @@ ENV HUGO_VERSION=0.57.0 \
35 35
 
36 36
 # Build hugo from source using specified version
37 37
 RUN \
38
-  apk add --update --no-cache git gcc g++ binutils musl-dev && \
38
+  apk add --update --no-cache git gcc g++ && \
39 39
   git clone https://github.com/gohugoio/hugo.git $GOPATH/src/github.com/gohugoio/hugo && \
40 40
   cd ${GOPATH:-$HOME/go}/src/github.com/gohugoio/hugo && \
41 41
   git checkout v$HUGO_VERSION && \
@@ -53,4 +53,4 @@ EXPOSE 80
53 53
 COPY --from=hugobuilder /go/bin/hugo /usr/local/bin/hugo
54 54
 COPY --from=sitebuilder /tmp/flying-toasters/ /opt/after-dark/
55 55
 ENTRYPOINT ["/usr/local/bin/hugo"]
56
-CMD ["serve","--buildDrafts","--bind","0.0.0.0","--port","80","--source","/opt/after-dark","--destination","/var/www"]
56
+CMD ["serve","--buildDrafts","--bind","0.0.0.0","--port","80","--source","/opt/after-dark","--destination","/var/www"]

+ 1
- 1
docker-compose.yml View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 # HOW TO USE THIS FILE
24 24
 #
25
-# 1. Install Docker and Docker Compose on a host
25
+# 1. Install Docker and Docker Compose on a host machine
26 26
 # 2. Copy `Dockerfile` and `docker-compose.yml` to directory of choice
27 27
 # 3. Run `docker build .` to build after-dark image
28 28
 # 4. Run `mkdir -p site/content` to contain your config and site content

+ 5
- 5
docker/hugo/Dockerfile View File

@@ -17,17 +17,17 @@
17 17
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
18 18
 #
19 19
 
20
-# DOCKER-VERSION 19.03.1-ce, build 74b1e89e8a
20
+# DOCKER-VERSION 19.03.5, build 633a0ea
21 21
 
22 22
 # Specify build image
23
-ARG GO_VERSION=1.11.4
24
-ARG BUILD_TARGET=alpine3.8
23
+ARG GO_VERSION=1.13.4
24
+ARG BUILD_TARGET=alpine3.10
25 25
 
26 26
 # Pull builder base image
27 27
 FROM golang:${GO_VERSION}-${BUILD_TARGET} AS hugobuilder
28 28
 
29 29
 # Set environment variables
30
-ENV HUGO_VERSION=0.57.0 \
30
+ENV HUGO_VERSION=0.60.0 \
31 31
     CGO_ENABLED=1 \
32 32
     GOOS=linux \
33 33
     GO111MODULE=on \
@@ -35,7 +35,7 @@ ENV HUGO_VERSION=0.57.0 \
35 35
 
36 36
 # Build from source using specified version
37 37
 RUN \
38
-  apk add --update --no-cache git gcc g++ binutils musl-dev && \
38
+  apk add --update --no-cache git gcc g++ && \
39 39
   git clone https://github.com/gohugoio/hugo.git $GOPATH/src/github.com/gohugoio/hugo && \
40 40
   cd ${GOPATH:-$HOME/go}/src/github.com/gohugoio/hugo && \
41 41
   git checkout v$HUGO_VERSION && \

+ 2
- 2
docs/content/feature/extended-builds.id.md View File

@@ -2,7 +2,7 @@
2 2
 title = "Extended Builds"
3 3
 description = "Build Hugo with Sass and Go CDK Deploy support."
4 4
 categories = ["core"]
5
-tags = ["docker", "container", "sass", "cloud"]
5
+tags = ["docker", "container", "sass", "cloud", "ci"]
6 6
 features = ["code highlighter", "related content"]
7 7
 [[copyright]]
8 8
   owner = "Josh Habdas"
@@ -31,7 +31,7 @@ Where `f2b785583ce8` is the scratch container's Image ID and `/usr/local/bin` is
31 31
 For builds without Sass support enabled turn off `CGO_ENABLED`, pass in a phony value to `BUILD_TAGS`, create another build and give it a docker tag:
32 32
 
33 33
 ```sh
34
-docker tag $(docker images -q | head -n 1) gohugoio/hugo:v0.57.0
34
+docker tag $(docker images -q | head -n 1) gohugoio/hugo:v0.60.0
35 35
 ```
36 36
 
37 37
 It's recommended at least 2GB of storage space is available when running builds. The resulting binary inside the scratch container is less than 50MB.

+ 2
- 2
docs/content/feature/extended-builds.md View File

@@ -15,7 +15,7 @@ After Dark ships with the ability to build Hugo from tagged-version source. Supp
15 15
 To use install Docker then run the following command:
16 16
 
17 17
 ```sh
18
-cd after-dark/docker/hugo && docker build --rm .
18
+cd after-dark/docker/hugo && docker build .
19 19
 ```
20 20
 
21 21
 Build container uses Alpine and includes `musl-dev` for high-performance. Update the `HUGO_VERSION` to get a specific Hugo release built. Upon successful build extract the resulting `hugo` binary out of the scratch container like:
@@ -31,7 +31,7 @@ Where `f2b785583ce8` is the scratch container's Image ID and `/usr/local/bin` is
31 31
 For builds without Sass support enabled turn off `CGO_ENABLED`, pass in a phony value to `BUILD_TAGS`, create another build and give it a docker tag:
32 32
 
33 33
 ```sh
34
-docker tag $(docker images -q | head -n 1) gohugoio/hugo:v0.57.0
34
+docker tag $(docker images -q | head -n 1) gohugoio/hugo:v0.60.0
35 35
 ```
36 36
 
37 37
 It's recommended at least 2GB of storage space is available when running builds. The resulting binary inside the scratch container is less than 50MB.

Loading…
Cancel
Save