Skip to content

Commit a72259c

Browse files
committed
docker build&push: some adjustments
1 parent 44eb513 commit a72259c

File tree

3 files changed

+12
-26
lines changed

3 files changed

+12
-26
lines changed

.github/workflows/build-and-push-image.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ jobs:
4444
uses: docker/login-action@v1
4545
with:
4646
registry: ghcr.io
47-
username: ${{ github.actor }}
48-
password: ${{ secrets.GITHUB_TOKEN }}
47+
username: ${{ github.repository_owner }}
48+
password: ${{ secrets.GPR_TOKEN }}
4949

5050
# prepare image tags
5151
- name: Prepare Image Tags
@@ -62,10 +62,8 @@ jobs:
6262
with:
6363
context: .
6464
file: ./dockerfiles/Dockerfile-for-frpc
65-
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
66-
push: ${{ github.event_name != 'pull_request' }}
67-
cache-from: type=local,src=/tmp/.buildx-cache
68-
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
65+
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
66+
push: true
6967
tags: |
7068
${{ env.TAG_FRPC }}
7169
${{ env.TAG_FRPC_GPR }}
@@ -75,10 +73,8 @@ jobs:
7573
with:
7674
context: .
7775
file: ./dockerfiles/Dockerfile-for-frps
78-
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
79-
push: ${{ github.event_name != 'pull_request' }}
80-
cache-from: type=local,src=/tmp/.buildx-cache
81-
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
76+
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
77+
push: true
8278
tags: |
8379
${{ env.TAG_FRPS }}
8480
${{ env.TAG_FRPS_GPR }}

dockerfiles/Dockerfile-for-frpc

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
FROM golang:1.18-alpine3.15 AS building
1+
FROM golang:1.18 AS building
22

33
COPY . /building
44
WORKDIR /building
55

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

11-
FROM alpine:3.15
12-
LABEL maintainer="[email protected]"
8+
FROM alpine:3
139

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

1612
ENTRYPOINT ["/usr/bin/frpc"]
17-
CMD ["-h"]

dockerfiles/Dockerfile-for-frps

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
FROM golang:1.18-alpine3.15 AS building
1+
FROM golang:1.18 AS building
22

33
COPY . /building
44
WORKDIR /building
55

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

11-
FROM alpine:3.15
12-
LABEL maintainer="[email protected]"
8+
FROM alpine:3
139

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

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

0 commit comments

Comments
 (0)