Skip to content

Commit

Permalink
up docker_arm64.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lejianwen committed Sep 26, 2024
1 parent fc3b5e3 commit f0a4bf6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docker_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
docker buildx create --use
docker buildx build --platform linux/arm64 \
-t lejianwen/rustdesk-api:actiontest-arm64 \
--push .
--push . -f ./Dockerfile_arm64
36 changes: 36 additions & 0 deletions Dockerfile_arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM arm64v8/golang:1.22-alpine3.19 as builder

RUN set -eux; \
apk add --no-cache git gcc build-base sqlite-dev npm nodejs; \
git clone https://github.com/lejianwen/rustdesk-api-web; \
git clone https://github.com/lejianwen/rustdesk-api; \
#先编译后台
cd rustdesk-api-web; \
npm install; \
npm run build; \
cd ..; \
mkdir -p rustdesk-api/resources/admin; \
cp -ar rustdesk-api-web/dist/* rustdesk-api/resources/admin; \
cd rustdesk-api; \
go mod tidy; \
go install github.com/swaggo/swag/cmd/swag@latest; \
swag init -g cmd/apimain.go --output docs/api --instanceName api --exclude http/controller/admin; \
swag init -g cmd/apimain.go --output docs/admin --instanceName admin --exclude http/controller/api; \
go env -w GO111MODULE=on;\
CGO_LDFLAGS="-static" CGO_ENABLED=1 GOARCH=arm64 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go; \
cp -ar resources release/; \
mkdir -p release/resources/public; \
cp -ar docs release/; \
cp -ar conf release/; \
mkdir -p release/data; \
mkdir -p release/runtime;


FROM arm64v8/alpine
WORKDIR /app
RUN apk add --no-cache tzdata
COPY --from=builder /go/rustdesk-api/release /app/
VOLUME /app/data

EXPOSE 21114
CMD ["./apimain"]

0 comments on commit f0a4bf6

Please sign in to comment.