Skip to content

Commit

Permalink
docker build&push: some adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
fatedier committed Apr 28, 2022
1 parent 44eb513 commit a72259c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/build-and-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GPR_TOKEN }}

# prepare image tags
- name: Prepare Image Tags
Expand All @@ -62,10 +62,8 @@ jobs:
with:
context: .
file: ./dockerfiles/Dockerfile-for-frpc
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
push: ${{ github.event_name != 'pull_request' }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
push: true
tags: |
${{ env.TAG_FRPC }}
${{ env.TAG_FRPC_GPR }}
Expand All @@ -75,10 +73,8 @@ jobs:
with:
context: .
file: ./dockerfiles/Dockerfile-for-frps
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
push: ${{ github.event_name != 'pull_request' }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
push: true
tags: |
${{ env.TAG_FRPS }}
${{ env.TAG_FRPS_GPR }}
11 changes: 3 additions & 8 deletions dockerfiles/Dockerfile-for-frpc
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
FROM golang:1.18-alpine3.15 AS building
FROM golang:1.18 AS building

COPY . /building
WORKDIR /building

RUN apk --no-cache add \
git \
&& export GO111MODULE=on \
&& env CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o ./bin/frpc ./cmd/frpc
RUN make frpc

FROM alpine:3.15
LABEL maintainer="[email protected]"
FROM alpine:3

COPY --from=building /building/bin/frpc /usr/bin/frpc

ENTRYPOINT ["/usr/bin/frpc"]
CMD ["-h"]
11 changes: 3 additions & 8 deletions dockerfiles/Dockerfile-for-frps
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
FROM golang:1.18-alpine3.15 AS building
FROM golang:1.18 AS building

COPY . /building
WORKDIR /building

RUN apk --no-cache add \
git \
&& export GO111MODULE=on \
&& env CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o ./bin/frps ./cmd/frps
RUN make frps

FROM alpine:3.15
LABEL maintainer="[email protected]"
FROM alpine:3

COPY --from=building /building/bin/frps /usr/bin/frps

ENTRYPOINT ["/usr/bin/frps"]
CMD ["-h"]

0 comments on commit a72259c

Please sign in to comment.