File tree Expand file tree Collapse file tree 3 files changed +31
-16
lines changed
Expand file tree Collapse file tree 3 files changed +31
-16
lines changed Original file line number Diff line number Diff line change 1+ FROM golang:1.8.3-alpine3.6 as builder
2+ WORKDIR /x/src/github.com/sapcc/swift-http-import/
3+ RUN apk add --no-cache curl make openssl && \
4+ mkdir -p /pkg/bin/ && \
5+ curl -L https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 > /pkg/bin/dumb-init && \
6+ chmod +x /pkg/bin/dumb-init
7+
8+ COPY . .
9+ RUN make install PREFIX=/pkg
10+
11+ # ###############################################################################
12+
113FROM alpine:latest
214MAINTAINER "Stefan Majewsky <stefan.majewsky@sap.com>"
15+ RUN apk add --no-cache ca-certificates
316
4- # wget(1) is only used to retrieve dumb-init
5- RUN apk update && \
6- apk add wget ca-certificates && \
7- wget -O /bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 && \
8- chmod +x /bin/dumb-init && \
9- apk del wget
10-
11- ADD swift-http-import /bin/swift-http-import
12- ENTRYPOINT ["/bin/dumb-init" , "--" , "/bin/swift-http-import" ]
17+ COPY --from=builder /pkg/ /usr/
18+ ENTRYPOINT ["/usr/bin/dumb-init" , "--" , "/usr/bin/swift-http-import" ]
Original file line number Diff line number Diff line change 1- all : swift-http-import
1+ PKG = github.com/sapcc/swift-http-import
2+ PREFIX := /usr
3+
4+ all : build/swift-http-import
25
36# force people to use golangvend
4- GOCC := env GOPATH=$(CURDIR ) /.gopath go
5- GOFLAGS := -ldflags '-s -w'
7+ GO := GOPATH=$(CURDIR ) /.gopath GOBIN=$(CURDIR ) /build go
8+ GO_BUILDFLAGS :=
9+ GO_LDFLAGS := -s -w
610
7- swift-http-import : * .go
8- $(GOCC ) build $(GOFLAGS ) -o $@ github.com/sapcc/swift-http-import
11+ build/ swift-http-import : FORCE
12+ $(GO ) install $(GO_BUILDFLAGS ) -ldflags ' $(GO_LDFLAGS) ' ' $(PKG) '
913
1014check : all
1115 bash tests.sh http
1216 bash tests.sh swift
1317 echo -e ' \e[1;32mSuccess!\e[0m'
1418
19+ install : FORCE all
20+ install -D -m 0755 build/swift-http-import " $( DESTDIR) $( PREFIX) /bin/swift-http-import"
21+
1522vendor :
23+ @# vendoring by https://github.com/holocm/golangvend
1624 @golangvend
17- .PHONY : vendor
25+
26+ .PHONY : FORCE
Original file line number Diff line number Diff line change 8888
8989mirror () {
9090 # config file comes from stdin
91- ./swift-http-import /proc/self/fd/0
91+ ./build/ swift-http-import /proc/self/fd/0
9292 # wait for container listing to get updated
9393 sleep 15
9494}
You can’t perform that action at this time.
0 commit comments