mirror of
https://github.com/tenox7/wrp.git
synced 2024-12-21 15:29:21 +00:00
use golang builder
This commit is contained in:
parent
93e9fddca7
commit
d8b4f160ac
10
Dockerfile
10
Dockerfile
@ -1,6 +1,14 @@
|
||||
FROM golang as builder
|
||||
WORKDIR /src
|
||||
RUN git clone https://github.com/tenox7/wrp.git
|
||||
WORKDIR /src/wrp
|
||||
RUN go mod download
|
||||
ARG TARGETARCH
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -o /wrp-${TARGETARCH}
|
||||
|
||||
FROM chromedp/headless-shell
|
||||
ARG TARGETARCH
|
||||
ADD wrp-${TARGETARCH}-linux /wrp
|
||||
COPY --from=builder /wrp-${TARGETARCH} /wrp
|
||||
ENTRYPOINT ["/wrp"]
|
||||
ENV PATH="/headless-shell:${PATH}"
|
||||
LABEL maintainer="as@tenoware.com"
|
||||
|
7
Makefile
7
Makefile
@ -13,9 +13,10 @@ cross:
|
||||
GOOS=linux GOARCH=arm go build -a -o wrp-arm-linux wrp.go
|
||||
GOOS=linux GOARCH=arm64 go build -a -o wrp-arm64-linux wrp.go
|
||||
|
||||
docker: wrp
|
||||
GOOS=linux GOARCH=amd64 go build -a -o wrp-amd64-linux wrp.go
|
||||
GOOS=linux GOARCH=arm64 go build -a -o wrp-arm64-linux wrp.go
|
||||
docker-local:
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t tenox7/wrp:latest --load .
|
||||
|
||||
docker-push:
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t tenox7/wrp:latest --push .
|
||||
|
||||
clean:
|
||||
|
Loading…
Reference in New Issue
Block a user