mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
docker build&push: some adjustments
This commit is contained in:
parent
44eb513f05
commit
a72259c604
16
.github/workflows/build-and-push-image.yml
vendored
16
.github/workflows/build-and-push-image.yml
vendored
@ -44,8 +44,8 @@ jobs:
|
|||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GPR_TOKEN }}
|
||||||
|
|
||||||
# prepare image tags
|
# prepare image tags
|
||||||
- name: Prepare Image Tags
|
- name: Prepare Image Tags
|
||||||
@ -62,10 +62,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./dockerfiles/Dockerfile-for-frpc
|
file: ./dockerfiles/Dockerfile-for-frpc
|
||||||
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
|
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: true
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
|
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.TAG_FRPC }}
|
${{ env.TAG_FRPC }}
|
||||||
${{ env.TAG_FRPC_GPR }}
|
${{ env.TAG_FRPC_GPR }}
|
||||||
@ -75,10 +73,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./dockerfiles/Dockerfile-for-frps
|
file: ./dockerfiles/Dockerfile-for-frps
|
||||||
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
|
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: true
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
|
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.TAG_FRPS }}
|
${{ env.TAG_FRPS }}
|
||||||
${{ env.TAG_FRPS_GPR }}
|
${{ env.TAG_FRPS_GPR }}
|
||||||
|
@ -1,17 +1,12 @@
|
|||||||
FROM golang:1.18-alpine3.15 AS building
|
FROM golang:1.18 AS building
|
||||||
|
|
||||||
COPY . /building
|
COPY . /building
|
||||||
WORKDIR /building
|
WORKDIR /building
|
||||||
|
|
||||||
RUN apk --no-cache add \
|
RUN make frpc
|
||||||
git \
|
|
||||||
&& export GO111MODULE=on \
|
|
||||||
&& env CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o ./bin/frpc ./cmd/frpc
|
|
||||||
|
|
||||||
FROM alpine:3.15
|
FROM alpine:3
|
||||||
LABEL maintainer="i@muir.fun"
|
|
||||||
|
|
||||||
COPY --from=building /building/bin/frpc /usr/bin/frpc
|
COPY --from=building /building/bin/frpc /usr/bin/frpc
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/frpc"]
|
ENTRYPOINT ["/usr/bin/frpc"]
|
||||||
CMD ["-h"]
|
|
@ -1,17 +1,12 @@
|
|||||||
FROM golang:1.18-alpine3.15 AS building
|
FROM golang:1.18 AS building
|
||||||
|
|
||||||
COPY . /building
|
COPY . /building
|
||||||
WORKDIR /building
|
WORKDIR /building
|
||||||
|
|
||||||
RUN apk --no-cache add \
|
RUN make frps
|
||||||
git \
|
|
||||||
&& export GO111MODULE=on \
|
|
||||||
&& env CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o ./bin/frps ./cmd/frps
|
|
||||||
|
|
||||||
FROM alpine:3.15
|
FROM alpine:3
|
||||||
LABEL maintainer="i@muir.fun"
|
|
||||||
|
|
||||||
COPY --from=building /building/bin/frps /usr/bin/frps
|
COPY --from=building /building/bin/frps /usr/bin/frps
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/bin/frps"]
|
ENTRYPOINT ["/usr/bin/frps"]
|
||||||
CMD ["-h"]
|
|
Loading…
Reference in New Issue
Block a user