Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #21 from secrethub/feature/dockerfile
Browse files Browse the repository at this point in the history
Build the binary in the Dockerfile
  • Loading branch information
SimonBarendse authored Apr 30, 2019
2 parents da9bba6 + 5af197f commit 8a0a440
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
10 changes: 0 additions & 10 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,3 @@ archive:
format: zip
files:
- LICENSE

dockers:
-
goos: linux
goarch: amd64
binaries:
- secrethub-http-proxy
image_templates:
- "secrethub/http-proxy:{{ .Version }}"
- "secrethub/http-proxy:latest"
19 changes: 16 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
FROM alpine
FROM golang:1.12-alpine as build_base
WORKDIR /build
ENV GO111MODULE=on
RUN apk add --update git
COPY go.mod .
COPY go.sum .
RUN go mod download

FROM build_base as build
RUN apk add --update make
COPY . .
RUN make build

COPY secrethub-http-proxy /usr/bin/secrethub-http-proxy
RUN apk add --no-cache ca-certificates && update-ca-certificates
FROM alpine
COPY --from=build /build/secrethub-http-proxy /usr/bin/secrethub-http-proxy
RUN apk add --no-cache ca-certificates && \
update-ca-certificates

EXPOSE 8080

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,18 @@ Get the source code:
git clone https://github.com/secrethub/secrethub-http-proxy
```

Build it using:
To build the binary from source, use:

```
make build
```

To build the Docker image from scratch, you can use:

```
docker build -t secrethub-http-proxy .
```

[circleci]: https://circleci.com/gh/secrethub/secrethub-http-proxy
[discord]: https://discord.gg/NWmxVeb
[latest-version]: https://github.com/secrethub/secrethub-http-proxy/releases/latest
Expand Down

0 comments on commit 8a0a440

Please sign in to comment.