Skip to content

Commit

Permalink
Merge pull request #252 from Admiral-Piett/docker-builds
Browse files Browse the repository at this point in the history
Fix releases and docker builds
  • Loading branch information
Admiral-Piett authored Feb 28, 2023
2 parents 10b1b90 + edfd3c9 commit 952c704
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
*.iml

dist/

Expand Down
11 changes: 7 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ builds:
goarm: 7

dockers:
-
- use: buildx
goos: linux
goarch: amd64
dockerfile: goreleaser.dockerfile
image_templates:
- "pafortin/goaws"
- "docker.io/pafortin/goaws:{{ .Tag }}"
- "docker.io/pafortin/goaws:latest"
- "admiralpiett/goaws"
- "admiralpiett/goaws:{{ .Tag }}"
- "admiralpiett/goaws:latest"
extra_files:
- app/conf/goaws.yaml

Expand Down
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# build image
FROM golang:alpine as build

WORKDIR /go/src/github.com/p4tin/goaws
WORKDIR /go/src/github.com/Admiral-Piett/goaws

COPY . .
COPY ./app/ ./app/
COPY ./go.mod .
COPY ./go.sum .

RUN ls -la
RUN CGO_ENABLED=0 go test ./app/...
RUN go build -o goaws app/cmd/goaws.go

# release image
FROM alpine

COPY --from=build /go/src/github.com/p4tin/goaws/goaws /goaws
COPY --from=build /go/src/github.com/Admiral-Piett/goaws/goaws /goaws

COPY app/conf/goaws.yaml /conf/

Expand Down
1 change: 1 addition & 0 deletions go.mod
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require (
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect
github.com/stretchr/testify v1.1.4
golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3 // indirect
golang.org/x/sys v0.5.0 // indirect
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384 h1:TFlARGu6Czu1z7q93HTxcP1P+/ZFC/IKythI5RzrnRg=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo=
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
Expand Down
6 changes: 6 additions & 0 deletions goreleaser.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM alpine

COPY goaws /
EXPOSE 4100

ENTRYPOINT ["./goaws"]

0 comments on commit 952c704

Please sign in to comment.