Skip to content

Commit 555f863

Browse files
author
Matthew Fisher
committed
fix(cache): use godep to build binaries
1 parent ce484e5 commit 555f863

7 files changed

Lines changed: 28 additions & 48 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ builder/image/bin/get-app-config
3131
builder/image/bin/get-app-values
3232
builder/image/bin/publish-release-controller
3333
builder/image/bin/yaml2json-procfile
34+
cache/image/bin
3435
client/dist/
3536
client/makeself/
3637
contrib/bumpver/bumpver

cache/Dockerfile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
FROM ubuntu-debootstrap:14.04
22

3-
ADD . /app
4-
5-
EXPOSE 6379
6-
7-
WORKDIR /app
8-
CMD ["/app/bin/boot"]
9-
10-
ENV DEIS_RELEASE 1.4.0-dev
11-
3+
# install deps
4+
RUN apt-get update && apt-get install -yq curl make gcc
5+
6+
ENV REDIS 2.8.19
7+
ENV SHA 3e362f4770ac2fdbdce58a5aa951c1967e0facc8
8+
9+
# install redis-server to /usr/local/bin
10+
RUN mkdir -p /usr/src/redis
11+
RUN curl -sSL http://download.redis.io/releases/redis-$REDIS.tar.gz | tar -xzC /usr/src/redis --strip-components=1 && \
12+
cd /usr/src/redis && \
13+
make && \
14+
make install

cache/Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@ include ../includes.mk
33
COMPONENT = cache
44
IMAGE = $(IMAGE_PREFIX)$(COMPONENT):$(BUILD_TAG)
55
DEV_IMAGE = $(DEV_REGISTRY)/$(IMAGE)
6-
BUILD_IMAGE := $(COMPONENT)-build
6+
BUILD_IMAGE = $(COMPONENT)-build
7+
BINARY_DEST_DIR = image/bin
78

89
build: check-docker
9-
docker build -t $(BUILD_IMAGE) image
10-
docker cp `docker run -d $(BUILD_IMAGE)`:/usr/local/bin/redis-server bin/
11-
docker cp `docker run -d $(BUILD_IMAGE)`:/go/bin/boot bin/
12-
docker build -t $(IMAGE) .
13-
rm bin/boot
14-
rm bin/redis-server
10+
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -v -ldflags '-s' -o $(BINARY_DEST_DIR)/boot main.go || exit 1
11+
docker build -t $(BUILD_IMAGE) .
12+
docker cp `docker run -d $(BUILD_IMAGE)`:/usr/local/bin/redis-server $(BINARY_DEST_DIR)/
13+
docker build -t $(IMAGE) image
1514

1615
clean: check-docker check-registry
17-
docker rmi $(IMAGE)
16+
rm -f $(BINARY_DEST_DIR)/boot
17+
rm -f $(BINARY_DEST_DIR)/redis-server
18+
docker rmi -f $(IMAGE)
1819

1920
full-clean: check-docker check-registry
2021
docker images -q $(IMAGE_PREFIX)$(COMPONENT) | xargs docker rmi -f

cache/image/Dockerfile

100755100644
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM golang:1.3
1+
FROM ubuntu-debootstrap:14.04
22

3-
ADD . /go/src/github.com/deis/deis/boot
3+
ADD . /app
4+
WORKDIR /app
45

5-
RUN DOCKER_BUILD=true /go/src/github.com/deis/deis/boot/build.sh
6+
CMD ["/app/bin/boot"]
7+
EXPOSE 6379
68

7-
WORKDIR /go/src/github.com/deis/deis/boot
8-
9-
RUN CGO_ENABLED=0 go get -a -ldflags '-s' github.com/deis/deis/boot
9+
ENV DEIS_RELEASE 1.4.0-dev

cache/image/build.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)