Skip to content

Commit

Permalink
Fixing docker files indentation + using specific scaler-types version (
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedingber authored Nov 3, 2019
1 parent fdfdfc6 commit c75791a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 30 deletions.
33 changes: 18 additions & 15 deletions autoscaler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,34 @@
# Build stage: builds the autoscaler binary
#

FROM golang:1.10-alpine3.7 as builder
FROM golang:1.10-alpine3.7 as builder

RUN apk --update --no-cache add \
RUN apk --update --no-cache add \
git \
gcc \
musl-dev

WORKDIR /go/src/github.com/v3io/app_resourcescaler
WORKDIR /go/src/github.com/v3io/app_resourcescaler

COPY . .
COPY . .

RUN go get github.com/v3io/scaler-types
RUN go get github.com/v3io/scaler-types \
&& cd $GOPATH/src/github.com/v3io/scaler-types \
&& git checkout v1.0.0 \
&& cd /go/src/github.com/v3io/app_resourcescaler

RUN mkdir -p /home/app_resourcescaler/bin \
&& GOOS=linux GOARCH=amd64 go build -buildmode=plugin -a -installsuffix cgo -ldflags="-s -w" \
-o /home/app_resourcescaler/plugins/plugin.so ./resourcescaler.go \
&& rm -rf /go/src/github.com/v3io/app_resourcescaler
RUN mkdir -p /home/app_resourcescaler/bin \
&& GOOS=linux GOARCH=amd64 go build -buildmode=plugin -a -installsuffix cgo -ldflags="-s -w" \
-o /home/app_resourcescaler/plugins/plugin.so ./resourcescaler.go \
&& rm -rf /go/src/github.com/v3io/app_resourcescaler

FROM alpine:3.7
FROM alpine:3.7

WORKDIR /home/app_resourcescaler
WORKDIR /home/app_resourcescaler

ENV PATH=/home/app_resourcescaler:$PATH
ENV PATH=/home/app_resourcescaler:$PATH

COPY --from=builder /home/app_resourcescaler/plugins/plugin.so /home/app_resourcescaler/plugins/plugin.so
COPY --from=quay.io/v3io/autoscaler:v0.0.2 /home/v3io/bin/autoscaler /home/app_resourcescaler/autoscaler
COPY --from=builder /home/app_resourcescaler/plugins/plugin.so /home/app_resourcescaler/plugins/plugin.so
COPY --from=quay.io/v3io/autoscaler:v0.0.2 /home/v3io/bin/autoscaler /home/app_resourcescaler/autoscaler

CMD ["autoscaler"]
CMD ["autoscaler"]
33 changes: 18 additions & 15 deletions dlx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,34 @@
# Build stage: builds the dlx binary
#

FROM golang:1.10-alpine3.7 as builder
FROM golang:1.10-alpine3.7 as builder

RUN apk --update --no-cache add \
RUN apk --update --no-cache add \
git \
gcc \
musl-dev

WORKDIR /go/src/github.com/v3io/app_resourcescaler
WORKDIR /go/src/github.com/v3io/app_resourcescaler

COPY . .
COPY . .

RUN go get github.com/v3io/scaler-types
RUN go get github.com/v3io/scaler-types \
&& cd $GOPATH/src/github.com/v3io/scaler-types \
&& git checkout v1.0.0 \
&& cd /go/src/github.com/v3io/app_resourcescaler

RUN mkdir -p /home/app_resourcescaler/bin \
&& GOOS=linux GOARCH=amd64 go build -buildmode=plugin -a -installsuffix cgo -ldflags="-s -w" \
-o /home/app_resourcescaler/plugins/plugin.so ./resourcescaler.go \
&& rm -rf /go/src/github.com/v3io/app_resourcescaler
RUN mkdir -p /home/app_resourcescaler/bin \
&& GOOS=linux GOARCH=amd64 go build -buildmode=plugin -a -installsuffix cgo -ldflags="-s -w" \
-o /home/app_resourcescaler/plugins/plugin.so ./resourcescaler.go \
&& rm -rf /go/src/github.com/v3io/app_resourcescaler

FROM alpine:3.7
FROM alpine:3.7

WORKDIR /home/app_resourcescaler
WORKDIR /home/app_resourcescaler

ENV PATH=/home/app_resourcescaler:$PATH
ENV PATH=/home/app_resourcescaler:$PATH

COPY --from=builder /home/app_resourcescaler/plugins/plugin.so /home/app_resourcescaler/plugins/plugin.so
COPY --from=quay.io/v3io/dlx:v0.0.1 /home/v3io/bin/dlx /home/app_resourcescaler/dlx
COPY --from=builder /home/app_resourcescaler/plugins/plugin.so /home/app_resourcescaler/plugins/plugin.so
COPY --from=quay.io/v3io/dlx:v0.0.1 /home/v3io/bin/dlx /home/app_resourcescaler/dlx

CMD ["dlx"]
CMD ["dlx"]

0 comments on commit c75791a

Please sign in to comment.