Skip to content

Commit

Permalink
更新Dockerfile以支持github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
thousmile committed Jul 1, 2024
1 parent 1cc3975 commit 0a67d34
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 90 deletions.
28 changes: 15 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM --platform=$TARGETPLATFORM alpine:3.18.6
ARG TARGETPLATFORM
ARG TARGETARCH
MAINTAINER Wang Chen Chen<[email protected]>
ENV VERSION 1.0
WORKDIR /apps
COPY dist/go_emqx_exhook_linux_${TARGETARCH}/go_emqx_exhook /apps/golang_app
COPY config.yaml /apps/config.yaml
RUN chown 1001 /apps
RUN chmod "g+rwX" /apps
RUN chown 1001:root /apps
ENV LANG C.UTF-8
FROM golang:1.22.4-bookworm AS builder
ENV GO111MODULE=on
ENV CGO_ENABLED=0
WORKDIR /build
ADD go.mod .
ADD go.sum .
RUN go mod download
COPY . .
RUN go build -o /build/app

FROM debian:stable-slim
WORKDIR /apps/
COPY --from=builder --chown=1001:root /build/app /apps/app
COPY --from=builder --chown=1001:root /build/config.yaml /apps/config.yaml
EXPOSE 16565
ENTRYPOINT /apps/golang_app
CMD ["./app"]
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module go_emqx_exhook

go 1.21
go 1.22

require (
github.com/IBM/sarama v1.43.2
Expand All @@ -24,7 +24,6 @@ require (
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand All @@ -38,7 +37,6 @@ require (
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand Down Expand Up @@ -68,7 +66,6 @@ require (
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240624140628-dc46fd24d27d // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
Loading

0 comments on commit 0a67d34

Please sign in to comment.