feat: add dockerfile for debian, alpine
This commit is contained in:
parent
36e77b1c7a
commit
9da8289ef8
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Dockerfile
|
||||||
|
Dockerfile.*
|
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
FROM golang:1.17.5-stretch AS Builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
RUN go mod download -x
|
||||||
|
RUN GOOS=linux GOARCH=amd64 go build -o webhook
|
||||||
|
|
||||||
|
FROM debian:stretch
|
||||||
|
LABEL maintainer "soulteary <soulteary@gmail.com>"
|
||||||
|
COPY --from=builder /app/webhook /bin/
|
||||||
|
CMD webhook
|
10
Dockerfile.alpine
Normal file
10
Dockerfile.alpine
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
FROM golang:1.17.5-alpine3.15 AS Builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
RUN go mod download -x
|
||||||
|
RUN GOOS=linux GOARCH=amd64 go build -o webhook
|
||||||
|
|
||||||
|
FROM alpine:3.15
|
||||||
|
LABEL maintainer "soulteary <soulteary@gmail.com>"
|
||||||
|
COPY --from=builder /app/webhook /bin/
|
||||||
|
CMD webhook
|
5
Makefile
5
Makefile
@ -1,5 +1,6 @@
|
|||||||
OS = darwin freebsd linux openbsd
|
OS = darwin freebsd linux openbsd
|
||||||
ARCHS = 386 arm amd64 arm64
|
ARCHS = 386 arm amd64 arm64
|
||||||
|
DOCKER_REPO_NAME=adnanh/webhook
|
||||||
|
|
||||||
.DEFAULT_GOAL := help
|
.DEFAULT_GOAL := help
|
||||||
|
|
||||||
@ -33,6 +34,10 @@ release-windows: clean deps ## Generate release for windows
|
|||||||
tar cz -C build -f build/webhook-windows-$$arch.tar.gz webhook-windows-$$arch; \
|
tar cz -C build -f build/webhook-windows-$$arch.tar.gz webhook-windows-$$arch; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
release-docker:
|
||||||
|
docker build -t "${DOCKER_REPO_NAME}" -f Dockerfile .
|
||||||
|
docker build -t "${DOCKER_REPO_NAME}:alpine" -f Dockerfile.alpine .
|
||||||
|
|
||||||
test: deps ## Execute tests
|
test: deps ## Execute tests
|
||||||
go test ./...
|
go test ./...
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user