-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docker): attempt to fix docker env variables and unify exports (#…
…41) chore(docker): attempt to fix docker env variables and unify exports
- Loading branch information
1 parent
4d3aa39
commit 246a6a6
Showing
6 changed files
with
20 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
FROM golang:1.11-alpine AS build | ||
ARG VERSION=0.0.0 | ||
ARG GIT_HASH=c0ff33 | ||
ARG SOURCE_BRANCH | ||
ARG SOURCE_COMMIT | ||
WORKDIR /go/src/github.com/target/flottbot/ | ||
RUN apk add --no-cache git | ||
RUN go get -u github.com/golang/dep/cmd/dep | ||
COPY / . | ||
RUN dep ensure | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ | ||
go build -ldflags "-X github.com/target/flottbot/version.Version=${VERSION} -X github.com/target/flottbot/version.GitHash=${GIT_HASH}" \ | ||
go build -ldflags "-X github.com/target/flottbot/version.Version=${SOURCE_BRANCH} -X github.com/target/flottbot/version.GitHash=${SOURCE_COMMIT}" \ | ||
-o flottbot . | ||
|
||
FROM alpine:3.8 | ||
RUN apk --no-cache add ca-certificates | ||
RUN mkdir config | ||
COPY --from=build /go/src/github.com/target/flottbot/flottbot . | ||
EXPOSE 8080 80 | ||
EXPOSE 8080 3000 4000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
FROM golang:1.11-alpine AS build | ||
ARG VERSION=0.0.0 | ||
ARG GIT_HASH=c0ff33 | ||
ARG SOURCE_BRANCH | ||
ARG SOURCE_COMMIT | ||
WORKDIR /go/src/github.com/target/flottbot/ | ||
RUN apk add --no-cache git | ||
RUN go get -u github.com/golang/dep/cmd/dep | ||
COPY / . | ||
RUN dep ensure | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ | ||
go build -ldflags "-X github.com/target/flottbot/version.Version=${VERSION} -X github.com/target/flottbot/version.GitHash=${GIT_HASH}" \ | ||
go build -ldflags "-X github.com/target/flottbot/version.Version=${SOURCE_BRANCH} -X github.com/target/flottbot/version.GitHash=${SOURCE_COMMIT}" \ | ||
-o flottbot . | ||
|
||
FROM golang:1.11-alpine | ||
RUN apk add --no-cache git | ||
RUN mkdir config | ||
COPY --from=build /go/src/github.com/target/flottbot/flottbot . | ||
EXPOSE 8080 80 | ||
EXPOSE 3000 3000 | ||
EXPOSE 4000 4000 | ||
EXPOSE 8080 3000 4000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
FROM golang:1.11-alpine AS build | ||
ARG VERSION=0.0.0 | ||
ARG GIT_HASH=c0ff33 | ||
ARG SOURCE_BRANCH | ||
ARG SOURCE_COMMIT | ||
WORKDIR /go/src/github.com/target/flottbot/ | ||
RUN apk add --no-cache git | ||
RUN go get -u github.com/golang/dep/cmd/dep | ||
COPY / . | ||
RUN dep ensure | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ | ||
go build -ldflags "-X github.com/target/flottbot/version.Version=${VERSION} -X github.com/target/flottbot/version.GitHash=${GIT_HASH}" \ | ||
go build -ldflags "-X github.com/target/flottbot/version.Version=${SOURCE_BRANCH} -X github.com/target/flottbot/version.GitHash=${SOURCE_COMMIT}" \ | ||
-o flottbot . | ||
|
||
FROM ruby:2.5-alpine | ||
RUN apk add --no-cache ruby-dev build-base | ||
RUN mkdir config | ||
COPY --from=build /go/src/github.com/target/flottbot/flottbot . | ||
EXPOSE 8080 80 | ||
EXPOSE 8080 3000 4000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash -xe | ||
DOCKER_PATH=$(echo $DOCKERFILE_PATH | sed -e 's/.*\///g') | ||
|
||
docker build \ | ||
--build-arg "SOURCE_BRANCH=$SOURCE_BRANCH" \ | ||
--build-arg "SOURCE_COMMIT=$SOURCE_COMMIT" \ | ||
-f $DOCKER_PATH \ | ||
-t $IMAGE_NAME ../ |
This file was deleted.
Oops, something went wrong.