Browse code

Improved aarch64 build

- Added 'golint', 'yamllint', and 'swagger'
- Fixed man/Dockerfile.aarch64 by bootstrapping Go 1.7.5

Signed-off-by: Boris Pruessmann <boris@pruessmann.org>

Boris Pruessmann authored on 2017/02/21 03:24:24
Showing 2 changed files
... ...
@@ -15,7 +15,7 @@
15 15
 # the case. Therefore, you don't have to disable it anymore.
16 16
 #
17 17
 
18
-FROM aarch64/ubuntu:wily
18
+FROM aarch64/ubuntu:xenial
19 19
 
20 20
 # Packaged dependencies
21 21
 RUN apt-get update && apt-get install -y \
... ...
@@ -39,6 +39,7 @@ RUN apt-get update && apt-get install -y \
39 39
 	libcap-dev \
40 40
 	libltdl-dev \
41 41
 	libsystemd-dev \
42
+	libyaml-dev \
42 43
 	mercurial \
43 44
 	net-tools \
44 45
 	parallel \
... ...
@@ -101,9 +102,20 @@ RUN mkdir /usr/src/go && curl -fsSL https://golang.org/dl/go${GO_VERSION}.src.ta
101 101
 	&& cd /usr/src/go/src \
102 102
 	&& GOOS=linux GOARCH=arm64 GOROOT_BOOTSTRAP="$(go env GOROOT)" ./make.bash
103 103
 
104
-ENV PATH /usr/src/go/bin:$PATH
104
+ENV PATH /go/bin:/usr/src/go/bin:$PATH
105 105
 ENV GOPATH /go
106 106
 
107
+# Dependency for golint
108
+ENV GO_TOOLS_COMMIT 823804e1ae08dbb14eb807afc7db9993bc9e3cc3
109
+RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
110
+	&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT)
111
+
112
+# Grab Go's lint tool
113
+ENV GO_LINT_COMMIT 32a87160691b3c96046c0c678fe57c5bef761456
114
+RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
115
+	&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
116
+	&& go install -v github.com/golang/lint/golint
117
+
107 118
 # Only install one version of the registry, because old version which support
108 119
 # schema1 manifests is not working on ARM64, we should skip integration-cli
109 120
 # tests for schema1 manifests on ARM64.
... ...
@@ -135,6 +147,15 @@ RUN git clone https://github.com/docker/docker-py.git /docker-py \
135 135
 	&& git checkout -q $DOCKER_PY_COMMIT \
136 136
 	&& pip install -r test-requirements.txt
137 137
 
138
+# Install yamllint for validating swagger.yaml
139
+RUN pip install yamllint==1.5.0
140
+
141
+# Install go-swagger for validating swagger.yaml
142
+ENV GO_SWAGGER_COMMIT c28258affb0b6251755d92489ef685af8d4ff3eb
143
+RUN git clone https://github.com/go-swagger/go-swagger.git /go/src/github.com/go-swagger/go-swagger \
144
+	&& (cd /go/src/github.com/go-swagger/go-swagger && git checkout -q $GO_SWAGGER_COMMIT) \
145
+	&& go install -v github.com/go-swagger/go-swagger/cmd/swagger
146
+
138 147
 # Set user.email so crosbymichael's in-container merge commits go smoothly
139 148
 RUN git config --global user.email 'docker-dummy@example.com'
140 149
 
... ...
@@ -1,6 +1,25 @@
1 1
 FROM    aarch64/ubuntu:xenial
2 2
 
3
-RUN     apt-get update && apt-get install -y git golang-go
3
+# allow replacing httpredir or deb mirror
4
+ARG     APT_MIRROR=deb.debian.org
5
+RUN     sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
6
+
7
+RUN     apt-get update && apt-get install -y \
8
+          git \
9
+          bash \
10
+          curl \
11
+          gcc \
12
+          gccgo \
13
+          make
14
+
15
+ENV     GO_VERSION 1.7.5
16
+ENV     GOARCH arm64
17
+ENV     PATH /go/bin:/usr/src/go/bin:$PATH
18
+
19
+RUN     mkdir /usr/src/go && \
20
+        curl -fsSL https://golang.org/dl/go${GO_VERSION}.src.tar.gz | tar -v -C /usr/src/go -xz --strip-components=1 && \
21
+        cd /usr/src/go/src && \
22
+        GOOS=linux GOARCH=arm64 GOROOT_BOOTSTRAP="$(go env GOROOT)" ./make.bash
4 23
 
5 24
 RUN     mkdir -p /go/src /go/bin /go/pkg
6 25
 ENV     GOPATH=/go