diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6dee62f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +# ignore everything +** + +# include src content +!go.mod +!go.sum +!*.go +!cmd diff --git a/CHANGELOG.md b/CHANGELOG.md index cbd67ee..b253df5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ This project adheres to [Semantic Versioning](http://semver.org/). Every release, along with the migration instructions, is documented on the Github [Releases page](https://github.com/SalesLoft/gorollout/releases). +### v1.1.2 + +Added Dockerfile + +### v1.1.1 + +Security updates and updated golang to v1.18 + ### v1.1.0 Added support for controlling the randomizing percentage between feature flags. Setting to false will ensure that features are active for the same teams when rolled out the same percentage. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..629931c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +ARG go_version=1.18 +FROM golang:${go_version}-alpine as build + +WORKDIR /src + +# install dependencies +ARG GOPROXY=https://proxy.golang.org +COPY go.mod go.sum ./ +RUN go mod download + +COPY feature.go manager.go ./ +COPY cmd ./cmd + +RUN CGO_ENABLED=0 go build -o /rollout ./cmd/rollout/main.go + +FROM scratch + +COPY --from=build /rollout /rollout +CMD [ "/rollout" ] diff --git a/README.md b/README.md index 294e9e7..839abb7 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,8 @@ func main() { ## Command Line Interface (CLI) gorollout also includes a [command line interface](cmd/rollout/README.md) for viewing and managing feature flags. + +## Building and pushing the Docker image + + docker buildx create --use + docker buildx build --platform linux/amd64,linux/arm64/v8 -t salesloft/gorollout:v1.1.2 . --push