Update docker support for ARM

This commit is contained in:
Stille 2021-05-31 11:17:54 +08:00
parent 5c8c7fccc9
commit 1528d0de48
3 changed files with 49 additions and 6 deletions

38
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: "build for docker"
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set tag
id: tag
run: |
TAG=$(cat Dockerfile | awk 'NR==4 {print $3}')
echo "::set-env name=TAG::$TAG"
- name: Docker Hub login
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
buildx-version: latest
- name: Build Dockerfile
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
docker buildx build \
--platform=linux/amd64,linux/arm64 \
--output "type=image,push=true" \
--file ./Dockerfile . \
--tag $(echo "${DOCKER_USERNAME}" | tr '[:upper:]' '[:lower:]')/${{ github.event.repository.name }}:latest \
--tag $(echo "${DOCKER_USERNAME}" | tr '[:upper:]' '[:lower:]')/${{ github.event.repository.name }}:${TAG}

View File

@ -1,8 +1,8 @@
FROM alpine:3.8
MAINTAINER Stille <stille@ioiox.com>
WORKDIR /
ENV FRP_VERSION 0.36.2
WORKDIR /
RUN set -xe && \
apk add tzdata && \
@ -11,14 +11,15 @@ RUN set -xe && \
apk del tzdata
RUN set -x && \
wget --no-check-certificate https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_amd64.tar.gz && \
tar xzf frp_${FRP_VERSION}_linux_amd64.tar.gz && \
cd frp_${FRP_VERSION}_linux_amd64 && \
if [ "$(uname -m)" = "x86_64" ]; then export PLATFORM=amd64 ; else if [ "$(uname -m)" = "aarch64" ]; then export PLATFORM=arm64 ; fi fi && \
wget --no-check-certificate https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_${PLATFORM}.tar.gz && \
tar xzf frp_${FRP_VERSION}_linux_${PLATFORM}.tar.gz && \
cd frp_${FRP_VERSION}_linux_${PLATFORM} && \
mkdir /frp && \
mv frps frps.ini /frp && \
cd .. && \
rm -rf *.tar.gz frp_${FRP_VERSION}_linux_amd64
rm -rf *.tar.gz frp_${FRP_VERSION}_linux_${PLATFORM}
VOLUME /frp
CMD /frp/frps -c /frp/frps.ini
CMD /frp/frps -c /frp/frps.ini

View File

@ -4,6 +4,10 @@
- GitHub [stilleshan/frps](https://github.com/stilleshan/frps)
- Docker [stilleshan/frps](https://hub.docker.com/r/stilleshan/frps)
> *docker image support for X86 and ARM*
## 更新
**2021-05-29** 更新从`0.36.2`版本起 docker 镜像同时支持 X86 和 ARM
## 使用说明
由于 frps 服务端需要配置参数,本脚本为原版 frps.ini ,安装完毕后请自行编辑 frps.ini 配置端口,密码等相关参数并重启服务.同时你也可以 fork 本仓库后自行修改 frps.ini ,在进行一键安装也非常方便.后期也可自行配置 frps.ini 和调整 frps 的版本.