From a5f7c681cbfb2dca536f34150939f38fe1e5b504 Mon Sep 17 00:00:00 2001 From: Evan Culver Date: Wed, 6 Mar 2019 17:39:53 -0800 Subject: [PATCH] Add Dockerfile (#130) This relates to a question brought up in #109. I went ahead and added a Dockerfile for executing the build in Ubuntu as a demonstration of this need for a dependency. --- Dockerfile | 21 +++++++++++++++++++++ README.md | 8 ++++++++ 2 files changed, 29 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..bff518e3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +from golang:1.11 as build + +ENV SRC github.com/segmentio/aws-okta +ARG VERSION + +WORKDIR /build +COPY . /go/src/${SRC} + +RUN apt-get update +RUN apt-get install --no-install-recommends -y \ + libusb-1.0-0-dev \ + ca-certificates \ + build-essential \ + git + +RUN CGO_ENABLED=1 go build -o aws-okta -ldflags="-X main.version=$VERSION" ${SRC}/cmd + +FROM scratch +COPY --from=build /build/aws-okta / +ENTRYPOINT ["/aws-okta"] + diff --git a/README.md b/README.md index d26b9120..264f2de5 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,14 @@ For Linux / Ubuntu add the following to your bash config / zshrc etc: export AWS_OKTA_BACKEND=secret-service ``` +## Local Development + +If you're developing in Linux, you'll need to get `libusb`. For Ubuntu, install the libusb-1.0-0-dev or use the `Dockerfile` provided in the repo. + +## Running Tests + +`make test` + ## Releasing Pushing a new tag will cause Circle to automatically create and push a linux release. After this is done, you should run (from a mac):