Skip to content

Commit

Permalink
ci: Resolve final docker build issues (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr authored Jan 30, 2020
1 parent ebb1744 commit d703a1e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ RUN apk add -U --no-cache ca-certificates

COPY kratos /usr/bin/kratos

# These directories must exist for packr to work. Directory `/home/project` is the one where the goreleaser orb
# builds the binary and copies the source code to.
RUN mkdir -p /home/project/contrib/sql/migrations /home/project/docs
USER ory

ENTRYPOINT ["kratos"]
Expand Down
19 changes: 15 additions & 4 deletions .docker/Dockerfile-goreleaser
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
FROM oryd/xgoreleaser:1.13.5
FROM oryd/xgoreleaser:1.13.7

WORKDIR /go/src/github.com/ory/kratos
WORKDIR /home/project

ADD . .
ADD go.mod go.mod
ADD go.sum go.sum

RUN go mod download

ENV RELEASE_NAME=v0.0.0-alpha.1
ENV DOCKER_SHORT_TAG=v0.0.0-alpha.1

ADD . .
ENTRYPOINT ["goreleaser"]
CMD ["--snapshot", "--skip-publish", "--rm-dist"]

# docker build -f .docker/Dockerfile-goreleaser -t build .; docker run --rm build
# Manual for debugging:
# docker build -f .docker/Dockerfile-goreleaser -t build .; docker run --rm build
#
# or:
# docker rm -f build || true; docker build -f .docker/Dockerfile-goreleaser -t build .; docker run --name build --entrypoint /bin/bash -it build
# goreleaser --snapshot --skip-publish --rm-dist
22 changes: 21 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,26 @@ archives:
- LICENSE
- README.md
- SECURITY.md
name_template: "{{ .ProjectName }}_sqlite_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
name_template: "{{ .ProjectName }}_{{ .Version }}-sqlite_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"

- id: kratos-sqlite-libmusl
builds:
- kratos-sqlite-linux-libmusl
replacements:
darwin: macos
386: 32bit
amd64: 64bit
arm: arm32
format_overrides:
-
goos: windows
format: zip
files:
- CHANGELOG.md
- LICENSE
- README.md
- SECURITY.md
name_template: "{{ .ProjectName }}_{{ .Version }}-sqlite-libmusl_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"

- id: kratos
builds:
Expand Down Expand Up @@ -218,4 +237,5 @@ release:
name_template: "{{.Env.RELEASE_NAME}}"
ids:
- kratos-sqlite
- kratos-sqlite-libmusl
- kratos
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ require (
github.com/ory/gojsonschema v1.2.0
github.com/ory/graceful v0.1.1
github.com/ory/herodot v0.6.3
github.com/ory/sdk/swagutil v0.0.0-20200130171837-e84d4a4046c8
github.com/ory/sdk/swagutil v0.0.0-20200130190227-e1f6d26486c5
github.com/ory/viper v1.5.6
github.com/ory/x v0.0.92
github.com/pelletier/go-toml v1.6.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,8 @@ github.com/ory/sdk/swagutil v0.0.0-20200129155727-8bfe32fcff3c h1:ZS2LX1iQd4aw7n
github.com/ory/sdk/swagutil v0.0.0-20200129155727-8bfe32fcff3c/go.mod h1:Ufg1eAyz+Zt3+oweSZVThG13ewewWCKwBmoNmK8Z0co=
github.com/ory/sdk/swagutil v0.0.0-20200130171837-e84d4a4046c8 h1:LBkYajX6JmhlRkj9cc6NV/sBNOhxMY/YpV9pz+PeyaA=
github.com/ory/sdk/swagutil v0.0.0-20200130171837-e84d4a4046c8/go.mod h1:Ufg1eAyz+Zt3+oweSZVThG13ewewWCKwBmoNmK8Z0co=
github.com/ory/sdk/swagutil v0.0.0-20200130190227-e1f6d26486c5 h1:sqkb7LZ5dg+zgDLjj/akeqYihllVb10SJ2cwN+hl89U=
github.com/ory/sdk/swagutil v0.0.0-20200130190227-e1f6d26486c5/go.mod h1:Ufg1eAyz+Zt3+oweSZVThG13ewewWCKwBmoNmK8Z0co=
github.com/ory/viper v1.5.6 h1:w4ceGgWwWLzAFYQ7bHaDZmwNsAto2JPVdyQjQnn7VWI=
github.com/ory/viper v1.5.6/go.mod h1:TYmpFpKLxjQwvT4f0QPpkOn4sDXU1kDgAwJpgLYiQ28=
github.com/ory/x v0.0.84 h1:foL2GSeL9yXBsEU14WcdX95H4Z0TmyodAJwdWkzvtHI=
Expand Down
22 changes: 0 additions & 22 deletions internal/httpclient/models/login_request_method.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d703a1e

Please sign in to comment.