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

Build lightstep image based on alpine #762

Merged
merged 2 commits into from
Sep 1, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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
8 changes: 6 additions & 2 deletions packaging/Dockerfile.lightstep
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
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
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 --rm -v $(shell pwd)/..:/go/src/$(PACKAGE) \
-w /go/src/$(PACKAGE)/packaging $(ALPINE_BUILD_IMAGE) \
make skipper eskip

alpine.plugins: docker-alpine-build
docker run --rm -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