Skip to content

Commit

Permalink
Reintroduces alpine based docker image
Browse files Browse the repository at this point in the history
Closes #703
  • Loading branch information
arekkas authored and arekkas committed Dec 12, 2017
1 parent 072e54b commit 0d47938
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
- setup_remote_docker:
version: 17.10.0-ce
- run: docker build -f Dockerfile -t hydra-test .
- run: docker build -f Dockerfile-alpine -t hydra-test-alpine .
- run: docker run hydra-test help

release:
Expand All @@ -84,8 +85,10 @@ jobs:
- run: ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace `git describe --tags` dist/
# Build and push docker image
- run: docker build --build-arg git_tag=$(git describe --tags) --build-arg git_commit=$(git rev-parse HEAD) -f Dockerfile -t oryd/hydra:$CIRCLE_TAG .
- run: docker build --build-arg git_tag=$(git describe --tags) --build-arg git_commit=$(git rev-parse HEAD) -f Dockerfile-alpine -t oryd/hydra:$CIRCLE_TAG-alpine .
- run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD"
- run: docker push oryd/hydra:$CIRCLE_TAG
- run: docker push oryd/hydra:$CIRCLE_TAG-alpine
# Release node / JavaScript SDK
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: sudo npm i -g npm
Expand Down
27 changes: 27 additions & 0 deletions Dockerfile-alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM golang:1.9-alpine

ARG git_tag
ARG git_commit

RUN apk add --no-cache git build-base curl
RUN curl -L -s https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 -o $GOPATH/bin/dep
RUN chmod +x $GOPATH/bin/dep

WORKDIR /go/src/github.com/ory/hydra

ADD ./Gopkg.lock ./Gopkg.lock
ADD ./Gopkg.toml ./Gopkg.toml
RUN dep ensure -vendor-only

ADD . .

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -X github.com/ory/hydra/cmd.Version=$git_tag -X github.com/ory/hydra/cmd.BuildTime=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory/hydra/cmd.GitHash=$git_commit" -a -installsuffix cgo -o hydra

FROM alpine:3.7

COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=0 /go/src/github.com/ory/hydra/hydra /usr/bin/hydra

ENTRYPOINT ["hydra"]

CMD ["host"]
2 changes: 2 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ a shell, which makes it harder to penetrate.
Instead of relying on tags to pass arguments, it is now possible to pass command arguments such as `docker run oryd/hydra:v0.10.0 host --dangerous-force-http`
directly.

**Version 0.10.8 reintroduces an image with a shell, appended with tag `-alpine`.**

### Important Additions

#### Prefixing Resources Names
Expand Down

0 comments on commit 0d47938

Please sign in to comment.