Skip to content

Commit

Permalink
feat: Improve docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
reneleonhardt committed Oct 31, 2023
1 parent 46266e4 commit b41b8ae
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 12 deletions.
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.circleci/
.git/
.github/
.idea/
.vscode/
conf/
doc/
dockerfiles/
hack/
test/
web/
*.md
*.sh
.dockerignore
.gitignore
.golangci.yml
.goreleaser.yml
LICENSE
Makefile.cross-compiles
24 changes: 18 additions & 6 deletions dockerfiles/Dockerfile-for-frpc
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
FROM golang:1.21 AS building
FROM golang:1.21 AS builder

COPY . /building
WORKDIR /building
COPY . .

RUN make frpc
RUN groupadd -g 1000 frpc && useradd -u 1000 -g frpc frpc \
&& make frpc

FROM alpine:3
FROM alpine:3.18

COPY --from=building /building/bin/frpc /usr/bin/frpc
LABEL org.opencontainers.image.authors="fatedier <[email protected]>"
LABEL org.opencontainers.image.base.name="docker.io/library/alpine:3.18"
LABEL org.opencontainers.image.description="A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet."
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.source="https://github.com/fatedier/frp"
LABEL org.opencontainers.image.title="frpc (client)"

ENTRYPOINT ["/usr/bin/frpc"]
WORKDIR /
COPY --from=builder /etc/passwd /etc/
COPY --from=builder --chown=1000:1000 /building/bin/frpc /usr/local/bin/

USER frpc

ENTRYPOINT ["/usr/local/bin/frpc"]
24 changes: 18 additions & 6 deletions dockerfiles/Dockerfile-for-frps
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
FROM golang:1.21 AS building
FROM golang:1.21 AS builder

COPY . /building
WORKDIR /building
COPY . .

RUN make frps
RUN groupadd -g 1000 frps && useradd -u 1000 -g frps frps \
&& make frps

FROM alpine:3
FROM alpine:3.18

COPY --from=building /building/bin/frps /usr/bin/frps
LABEL org.opencontainers.image.authors="fatedier <[email protected]>"
LABEL org.opencontainers.image.base.name="docker.io/library/alpine:3.18"
LABEL org.opencontainers.image.description="A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet."
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.source="https://github.com/fatedier/frp"
LABEL org.opencontainers.image.title="frps (server)"

ENTRYPOINT ["/usr/bin/frps"]
WORKDIR /
COPY --from=builder /etc/passwd /etc/
COPY --from=builder --chown=1000:1000 /building/bin/frps /usr/local/bin/

USER frps

ENTRYPOINT ["/usr/local/bin/frps"]

0 comments on commit b41b8ae

Please sign in to comment.