Fix ARM64 compatibility issues (#192)
* 2021/11/01/22 Github_Action * Update docker.yml Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@ -19,7 +19,7 @@
|
|||||||
bin
|
bin
|
||||||
data
|
data
|
||||||
docs
|
docs
|
||||||
guacd
|
# guacd
|
||||||
logs
|
logs
|
||||||
playground
|
playground
|
||||||
screenshot
|
screenshot
|
||||||
|
126
.github/workflows/docker.yml
vendored
126
.github/workflows/docker.yml
vendored
@ -1,41 +1,109 @@
|
|||||||
name: Docker image
|
name: Docker next-terminal Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
branches:
|
inputs:
|
||||||
- "master"
|
days:
|
||||||
paths-ignore:
|
description: 'Number of days.'
|
||||||
- ".gitignore"
|
required: true
|
||||||
- "*.md"
|
default: "20"
|
||||||
- "*.png"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
DOCKERHUB_next-terminal_Build:
|
||||||
|
name: Docker next-terminal Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
-
|
||||||
|
name: Private Actions Checkout
|
||||||
- uses: actions/setup-node@v2
|
uses: actions/checkout@v2.3.4
|
||||||
|
-
|
||||||
|
name: Docker Setup QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1.2.0
|
||||||
|
-
|
||||||
|
name: Docker Setup Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1.6.0
|
||||||
|
-
|
||||||
|
name: node Setup
|
||||||
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: '14'
|
node-version: '14'
|
||||||
|
-
|
||||||
- run: |
|
name: npm install
|
||||||
|
run: |
|
||||||
cd web
|
cd web
|
||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
|
-
|
||||||
- name: Log into registry
|
name: Docker Login
|
||||||
run: echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
|
uses: docker/login-action@v1.10.0
|
||||||
|
|
||||||
- name: Build and push image
|
|
||||||
run: |
|
|
||||||
docker build -t ghcr.io/${{ github.repository_owner }}/next-terminal -f Dockerfile .
|
|
||||||
docker push ghcr.io/${{ github.repository_owner }}/next-terminal
|
|
||||||
|
|
||||||
- name: Push to Docker Hub
|
|
||||||
uses: docker/build-push-action@v1
|
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
repository: ${{ github.repository_owner }}/next-terminal
|
-
|
||||||
tag_with_ref: true
|
name: Build and push Docker images
|
||||||
|
uses: docker/build-push-action@v2.7.0
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/arm64,linux/amd64
|
||||||
|
file: Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ secrets.DOCKERHUB_USERNAME }}/next-terminal:latest
|
||||||
|
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/next-terminal:cache
|
||||||
|
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/next-terminal:cache,mode=max
|
||||||
|
|
||||||
|
DOCKERHUB_Guacd_Build:
|
||||||
|
name: Docker Guacd Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Private Actions Checkout
|
||||||
|
uses: actions/checkout@v2.3.4
|
||||||
|
-
|
||||||
|
name: Docker Setup QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1.2.0
|
||||||
|
-
|
||||||
|
name: Docker Setup Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1.6.0
|
||||||
|
-
|
||||||
|
name: Docker Login
|
||||||
|
uses: docker/login-action@v1.10.0
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
-
|
||||||
|
name: Build and push Docker images
|
||||||
|
uses: docker/build-push-action@v2.7.0
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/arm64,linux/amd64
|
||||||
|
file: guacd/Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ secrets.DOCKERHUB_USERNAME }}/guacd:1.3.0
|
||||||
|
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/guacd:cache
|
||||||
|
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/guacd:cache,mode=max
|
||||||
|
|
||||||
|
DOCKERHUB_Hub_Description:
|
||||||
|
needs: [DOCKERHUB_next-terminal_Build, DOCKERHUB_Guacd_Build]
|
||||||
|
name: Docker Build PHP_INIT
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Private Actions Checkout
|
||||||
|
uses: actions/checkout@v2.3.4
|
||||||
|
-
|
||||||
|
name: Docker Hub Description
|
||||||
|
uses: peter-evans/dockerhub-description@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
repository: ${{ secrets.DOCKERHUB_USERNAME }}/next-terminal
|
||||||
|
-
|
||||||
|
name: Delete workflow runs
|
||||||
|
uses: Mattraks/delete-workflow-runs@main
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.TOKEN_GITHUB }}
|
||||||
|
repository: ${{ github.repository }}
|
||||||
|
retain_days: ${{ github.event.inputs.days }}
|
||||||
|
keep_minimum_runs: 3
|
||||||
|
@ -10,7 +10,7 @@ COPY . .
|
|||||||
|
|
||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
|
||||||
RUN apk add gcc g++
|
RUN apk add gcc g++
|
||||||
RUN go env && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -ldflags '-linkmode external -extldflags "-static"' -o next-terminal main.go
|
RUN go env;ARCH="$(arch)";case "$ARCH" in 'x86_64') export ARCH='amd64';echo $ARCH;; 'aarch64') export ARCH='arm64';echo $ARCH;; 'i386') export ARCH='i386';echo $ARCH;; esac;CGO_ENABLED=1 GOOS=linux GOARCH=$ARCH go build -a -ldflags '-linkmode external -extldflags "-static"' -o next-terminal main.go
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
FROM guacamole/guacd:1.3.0
|
FROM xrsec/guacd:1.3.0
|
||||||
|
|
||||||
LABEL MAINTAINER="helloworld1024@foxmail.com"
|
LABEL MAINTAINER="helloworld1024@foxmail.com"
|
||||||
|
|
||||||
COPY ./fonts/Menlo-Regular.ttf /usr/share/fonts/
|
COPY ./guacd/fonts/Menlo-Regular.ttf /usr/share/fonts/
|
||||||
COPY ./fonts/SourceHanSansCN-Regular.otf /usr/share/fonts/
|
COPY ./guacd/fonts/SourceHanSansCN-Regular.otf /usr/share/fonts/
|
||||||
|
|
||||||
RUN mkfontscale && mkfontdir && fc-cache
|
RUN mkfontscale && mkfontdir && fc-cache
|
Reference in New Issue
Block a user