Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nginx image as base and install go on top #2827

Merged
merged 1 commit into from
Jul 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 36 additions & 18 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,40 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.10.3-stretch

RUN apt update \
&& apt install -y --no-install-recommends \
luarocks \
&& apt-get clean -y \
&& rm -rf \
/var/cache/debconf/* \
/var/lib/apt/lists/* \
/var/log/* \
/tmp/* \
/var/tmp/*

RUN luarocks install luacheck \
&& luarocks install busted 2.0.rc12 \
&& luarocks install lua-cjson 2.1.0-1

RUN go get github.com/onsi/ginkgo/ginkgo \
FROM quay.io/kubernetes-ingress-controller/nginx-amd64:0.54

RUN clean-install \
g++ \
gcc \
git \
libc6-dev \
make \
wget \
luarocks \
pkg-config

ENV GOLANG_VERSION 1.10.3
ENV GO_ARCH linux-amd64
ENV GOLANG_SHA fa1b0e45d3b647c252f51f5e1204aba049cde4af177ef9f2181f43004f901035

RUN set -eux; \
url="https://golang.org/dl/go${GOLANG_VERSION}.${GO_ARCH}.tar.gz"; \
wget -O go.tgz "$url"; \
echo "${GOLANG_SHA} *go.tgz" | sha256sum -c -; \
tar -C /usr/local -xzf go.tgz; \
rm go.tgz; \
export PATH="/usr/local/go/bin:$PATH"; \
go version

ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH

RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"

WORKDIR $GOPATH

RUN luarocks install luacheck \
&& luarocks install busted 2.0.rc12

RUN go get github.com/onsi/ginkgo/ginkgo \
&& go get golang.org/x/lint/golint