Skip to content

Commit

Permalink
Merge pull request #34 from dilyar85/multi-stage-build
Browse files Browse the repository at this point in the history
Apply multi-stage build in Dockerfile
  • Loading branch information
gregory-lyons authored Apr 3, 2019
2 parents 09c219c + 3ce2ae6 commit 9197f3c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: go
go:
- 1.7
install: true
script:
- make test-unit
- .travis/check_workspace.sh
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM ubuntu
FROM golang:1.7 as builder
WORKDIR $GOPATH/src/github.com/box/kube-applier
COPY . $GOPATH/src/github.com/box/kube-applier
RUN make build

FROM ubuntu
LABEL maintainer="Greg Lyons<[email protected]>"
WORKDIR /root/
ADD templates/* /templates/

ADD static/ /static/

RUN apt-get update && \
apt-get install -y git

ADD https://storage.googleapis.com/kubernetes-release/release/v1.9.4/bin/linux/amd64/kubectl /usr/local/bin/kubectl

RUN chmod +x /usr/local/bin/kubectl

COPY kube-applier /kube-applier
COPY --from=builder /go/src/github.com/box/kube-applier/kube-applier /kube-applier
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
all: build

ENVVAR = GOOS=linux GOARCH=amd64 CGO_ENABLED=0
TAG = v0.1.0
TAG = v0.2.0
GODEP_BIN = $$GOPATH/bin/godep

deps:
Expand All @@ -10,7 +10,7 @@ deps:
build: clean deps fmt
$(ENVVAR) $(GODEP_BIN) go build -o kube-applier

container: build
container:
docker build -t kube-applier:$(TAG) .

clean:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ kube-applier serves a [status page](#status-ui) and provides [metrics](#metrics)

## Requirements
* [Go (1.7+)](https://golang.org/dl/)
* [Docker (1.10+)](https://docs.docker.com/engine/getstarted/step_one/#step-1-get-docker)
* [Docker (17.05+)](https://docs.docker.com/engine/getstarted/step_one/#step-1-get-docker)
* [Kubernetes cluster](http://kubernetes.io/docs/getting-started-guides/binary_release/)
* The kubectl version specified in the Dockerfile must be either the same minor release as the cluster API server, or one release behind the server (e.g. client 1.3 and server 1.4 is fine, but client 1.4 and server 1.3 is not).
* Supported Kubernetes releases:
Expand Down
2 changes: 1 addition & 1 deletion demo/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
value: "/k8s/resources"
- name: "LISTEN_PORT"
value: "2020"
image: "kube-applier:v0.1.0"
image: "kube-applier:v0.2.0"
ports:
- containerPort: 2020
volumeMounts:
Expand Down

0 comments on commit 9197f3c

Please sign in to comment.