Skip to content

Commit

Permalink
Build lightstep image based on alpine
Browse files Browse the repository at this point in the history
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
  • Loading branch information
mikkeloscar committed Sep 1, 2018
1 parent 5d7ae30 commit e0c05c6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 10 deletions.
9 changes: 9 additions & 0 deletions packaging/Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM golang:alpine

ENV CGO_ENABLED 1
ENV GOOS linux
ENV GOARCH amd64

# add build deps
RUN apk add -U git build-base && \
go get github.com/Masterminds/glide
9 changes: 7 additions & 2 deletions packaging/Dockerfile.lightstep
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
FROM registry.opensource.zalan.do/stups/ubuntu:latest
FROM registry.opensource.zalan.do/stups/alpine:latest
MAINTAINER Skipper Maintainers <team-pathfinder@zalando.de>
RUN apk --no-cache add ca-certificates && update-ca-certificates
RUN mkdir -p /usr/bin
ADD skipper eskip /usr/bin/
EXPOSE 9090 9911
ENV PATH $PATH:/usr/bin
RUN mkdir -p /plugins
ADD build/tracing_lightstep.so /plugins/

EXPOSE 9090 9911

ENTRYPOINT ["/usr/bin/skipper", "-plugindir", "/plugins"]
31 changes: 23 additions & 8 deletions packaging/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
.PHONY: docker-push

VERSION ?= $(shell git rev-parse HEAD)
REGISTRY ?= registry-write.opensource.zalan.do/pathfinder
IMAGE ?= $(REGISTRY)/skipper:$(VERSION)
LIGHTSTEP_IMAGE ?= $(REGISTRY)/skipper-lightstep:$(VERSION)
CGO_ENABLED ?= 0
VERSION ?= $(shell git rev-parse HEAD)
REGISTRY ?= registry-write.opensource.zalan.do/pathfinder
IMAGE ?= $(REGISTRY)/skipper:$(VERSION)
LIGHTSTEP_IMAGE ?= $(REGISTRY)/skipper-lightstep:$(VERSION)
ALPINE_BUILD_IMAGE ?= $(REGISTRY)/skipper-alpine-build:latest
PACKAGE ?= github.com/zalando/skipper
CGO_ENABLED ?= 0

default: docker-build

skipper:
GOOS=linux GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) go build github.com/zalando/skipper/cmd/skipper
GOOS=linux GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) go build $(PACKAGE)/cmd/skipper

eskip:
GOOS=linux GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) go build github.com/zalando/skipper/cmd/eskip
GOOS=linux GOARCH=amd64 CGO_ENABLED=$(CGO_ENABLED) go build $(PACKAGE)/cmd/eskip

clean:
rm -rf skipper eskip build/
Expand All @@ -31,7 +33,20 @@ plugins:
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 make ;\
cp build/*.so $$CUR/build/

docker-lightstep-build: skipper eskip plugins
alpine.build: docker-alpine-build
docker run -v $(shell pwd)/..:/go/src/$(PACKAGE) \
-w /go/src/$(PACKAGE)/packaging $(ALPINE_BUILD_IMAGE) \
make skipper eskip

alpine.plugins: docker-alpine-build
docker run -v $(shell pwd)/..:/go/src/$(PACKAGE) \
-w /go/src/$(PACKAGE)/packaging $(ALPINE_BUILD_IMAGE) \
make plugins

docker-alpine-build:
docker build --rm -t $(ALPINE_BUILD_IMAGE) -f Dockerfile.alpine .

docker-lightstep-build: alpine.build alpine.plugins
docker build -t $(LIGHTSTEP_IMAGE) -f Dockerfile.lightstep .

docker-lightstep-push:
Expand Down

0 comments on commit e0c05c6

Please sign in to comment.