Commit 85b3b392 authored by Geoff Simmons's avatar Geoff Simmons

Bugfix and refactor the docker build.

- Correctly identify the executable to build and copy.
- Order layers more efficiently (don't repeat commands that rarely
  change and take significant time).
parent 40d09d99
FROM golang:1.10.3 as builder
COPY . /go/src/code.uplex.de/uplex-varnish/k8s-ingress
ARG PACKAGES
RUN go get -d -v github.com/slimhazard/gogitversion && \
cd /go/src/github.com/slimhazard/gogitversion && \
make install && \
cd /go/src/code.uplex.de/uplex-varnish/k8s-ingress && \
go get -v $PACKAGES && \
go generate && \
CGO_ENABLED=0 GOOS=linux go build -o k8-ingress *.go
make install
RUN go get -v $PACKAGES
COPY . /go/src/code.uplex.de/uplex-varnish/k8s-ingress
WORKDIR /go/src/code.uplex.de/uplex-varnish/k8s-ingress
RUN go generate && \
CGO_ENABLED=0 GOOS=linux go build -o k8s-ingress *.go
FROM centos:centos7
COPY varnishcache_varnish60.repo /etc/yum.repos.d/
......@@ -18,5 +18,5 @@ RUN yum install -y epel-release && yum update -y -q && \
yum install -y -q --nogpgcheck vmod-re2-1.5.1 && \
yum clean all && rm -rf /var/cache/yum
COPY varnish/vcl/vcl.tmpl /
COPY --from=builder /go/src/code.uplex.de/uplex-varnish/k8s-ingress .
ENTRYPOINT ["./k8s-ingress"]
COPY --from=builder /go/src/code.uplex.de/uplex-varnish/k8s-ingress/k8s-ingress /k8s-ingress
ENTRYPOINT ["/k8s-ingress"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment